Skip to content

Commit ff09809

Browse files
committed
reinstate workarounds for vc7
[SVN r18490]
1 parent 43e5ccd commit ff09809

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

include/boost/python/detail/destroy.hpp

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@
77
# define DESTROY_DWA2002221_HPP
88

99
# include <boost/type_traits/is_array.hpp>
10-
10+
# include <boost/detail/workaround.hpp>
11+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
12+
# include <boost/type_traits/is_enum.hpp>
13+
# endif
1114
namespace boost { namespace python { namespace detail {
1215

13-
template <bool array> struct value_destroyer;
16+
template <
17+
bool array
18+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
19+
, bool enum_ // vc7 has a problem destroying enums
20+
# endif
21+
> struct value_destroyer;
1422

1523
template <>
16-
struct value_destroyer<false>
24+
struct value_destroyer<
25+
false
26+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
27+
, false
28+
# endif
29+
>
1730
{
1831
template <class T>
1932
static void execute(T const volatile* p)
@@ -23,7 +36,12 @@ struct value_destroyer<false>
2336
};
2437

2538
template <>
26-
struct value_destroyer<true>
39+
struct value_destroyer<
40+
true
41+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
42+
, false
43+
# endif
44+
>
2745
{
2846
template <class A, class T>
2947
static void execute(A*, T const volatile* const first)
@@ -32,6 +50,9 @@ struct value_destroyer<true>
3250
{
3351
value_destroyer<
3452
boost::is_array<T>::value
53+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
54+
, boost::is_enum<T>::value
55+
# endif
3556
>::execute(p);
3657
}
3758
}
@@ -43,13 +64,35 @@ struct value_destroyer<true>
4364
}
4465
};
4566

67+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
68+
template <>
69+
struct value_destroyer<true,true>
70+
{
71+
template <class T>
72+
static void execute(T const volatile*)
73+
{
74+
}
75+
};
76+
77+
template <>
78+
struct value_destroyer<false,true>
79+
{
80+
template <class T>
81+
static void execute(T const volatile*)
82+
{
83+
}
84+
};
85+
# endif
4686
template <class T>
4787
inline void destroy_referent_impl(void* p, T& (*)())
4888
{
4989
// note: cv-qualification needed for MSVC6
5090
// must come *before* T for metrowerks
5191
value_destroyer<
5292
(boost::is_array<T>::value)
93+
# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
94+
, (boost::is_enum<T>::value)
95+
# endif
5396
>::execute((const volatile T*)p);
5497
}
5598

0 commit comments

Comments
 (0)