From ff0980914bc118c1fcde8c4778985f1275899231 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 22 May 2003 01:34:04 +0000 Subject: [PATCH] reinstate workarounds for vc7 [SVN r18490] --- include/boost/python/detail/destroy.hpp | 51 +++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/include/boost/python/detail/destroy.hpp b/include/boost/python/detail/destroy.hpp index f134a124..475548b6 100644 --- a/include/boost/python/detail/destroy.hpp +++ b/include/boost/python/detail/destroy.hpp @@ -7,13 +7,26 @@ # define DESTROY_DWA2002221_HPP # include - +# include +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) +# include +# endif namespace boost { namespace python { namespace detail { -template struct value_destroyer; +template < + bool array +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) + , bool enum_ // vc7 has a problem destroying enums +# endif + > struct value_destroyer; template <> -struct value_destroyer +struct value_destroyer< + false +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) + , false +# endif + > { template static void execute(T const volatile* p) @@ -23,7 +36,12 @@ struct value_destroyer }; template <> -struct value_destroyer +struct value_destroyer< + true +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) + , false +# endif + > { template static void execute(A*, T const volatile* const first) @@ -32,6 +50,9 @@ struct value_destroyer { value_destroyer< boost::is_array::value +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) + , boost::is_enum::value +# endif >::execute(p); } } @@ -43,6 +64,25 @@ struct value_destroyer } }; +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) +template <> +struct value_destroyer +{ + template + static void execute(T const volatile*) + { + } +}; + +template <> +struct value_destroyer +{ + template + static void execute(T const volatile*) + { + } +}; +# endif template inline void destroy_referent_impl(void* p, T& (*)()) { @@ -50,6 +90,9 @@ inline void destroy_referent_impl(void* p, T& (*)()) // must come *before* T for metrowerks value_destroyer< (boost::is_array::value) +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) + , (boost::is_enum::value) +# endif >::execute((const volatile T*)p); }