From 232a2f904816852946acd452ebb6498f6940dc71 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 7 Jan 2004 05:03:10 +0000 Subject: [PATCH] VC7.1+ workaround :( [SVN r21523] --- include/boost/mpl/aux_/has_xxx.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/boost/mpl/aux_/has_xxx.hpp b/include/boost/mpl/aux_/has_xxx.hpp index e6609d2..cf32526 100644 --- a/include/boost/mpl/aux_/has_xxx.hpp +++ b/include/boost/mpl/aux_/has_xxx.hpp @@ -31,6 +31,32 @@ // the implementation below is based on a USENET newsgroup's posting by // Rani Sharoni (comp.lang.c++.moderated, 2002-03-17 07:45:09 PST) +# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) + +# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \ +template< typename T > \ +boost::mpl::aux::yes_tag \ +trait##_helper( \ + boost::mpl::aux::type_wrapper const volatile* \ + , boost::mpl::aux::type_wrapper* = 0 \ + ); \ + \ +boost::mpl::aux::no_tag \ +trait##_helper(...); \ + \ +template< typename T > \ +struct trait \ +{ \ + typedef boost::mpl::aux::type_wrapper t_; \ + BOOST_STATIC_CONSTANT(bool, value = \ + sizeof((trait##_helper)(static_cast(0))) \ + == sizeof(boost::mpl::aux::yes_tag) \ + ); \ +}; \ +/**/ + +# else // conforming compilers + # define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \ template< typename T > \ struct trait \ @@ -58,6 +84,8 @@ struct trait \ }; \ /**/ +# endif + # else # include "boost/mpl/if.hpp"