77
88# include < boost/type_traits/is_array.hpp>
99# include < boost/detail/workaround.hpp>
10- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
11- # include < boost/type_traits/is_enum.hpp>
12- # endif
1310namespace boost { namespace python { namespace detail {
1411
15- template <
16- bool array
17- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
18- , bool enum_ // vc7 has a problem destroying enums
19- # endif
20- > struct value_destroyer ;
12+ template <bool array> struct value_destroyer ;
2113
2214template <>
23- struct value_destroyer <
24- false
25- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
26- , false
27- # endif
28- >
15+ struct value_destroyer <false >
2916{
3017 template <class T >
3118 static void execute (T const volatile * p)
@@ -35,12 +22,7 @@ struct value_destroyer<
3522};
3623
3724template <>
38- struct value_destroyer <
39- true
40- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
41- , false
42- # endif
43- >
25+ struct value_destroyer <true >
4426{
4527 template <class A , class T >
4628 static void execute (A*, T const volatile * const first)
@@ -49,9 +31,6 @@ struct value_destroyer<
4931 {
5032 value_destroyer<
5133 boost::is_array<T>::value
52- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
53- , boost::is_enum<T>::value
54- # endif
5534 >::execute (p);
5635 }
5736 }
@@ -63,35 +42,13 @@ struct value_destroyer<
6342 }
6443};
6544
66- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
67- template <>
68- struct value_destroyer <true ,true >
69- {
70- template <class T >
71- static void execute (T const volatile *)
72- {
73- }
74- };
75-
76- template <>
77- struct value_destroyer <false ,true >
78- {
79- template <class T >
80- static void execute (T const volatile *)
81- {
82- }
83- };
84- # endif
8545template <class T >
8646inline void destroy_referent_impl (void * p, T& (*)())
8747{
8848 // note: cv-qualification needed for MSVC6
8949 // must come *before* T for metrowerks
9050 value_destroyer<
9151 (boost::is_array<T>::value)
92- # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
93- , (boost::is_enum<T>::value)
94- # endif
9552 >::execute ((const volatile T*)p);
9653}
9754
0 commit comments