Previous implementation actually failed to give correct results on

many good compilers.  Still wondering about the use of
type_wrapper<T>* here. Wouldn't it be better to pass T*, and strip
const/volatile in has_##name##_helper ?


[SVN r16168]
This commit is contained in:
Dave Abrahams
2002-11-09 01:20:44 +00:00
parent 8d124d88bb
commit 86be3ece35

View File

@@ -35,20 +35,18 @@ template< typename T > \
boost::mpl::aux::yes_tag \ boost::mpl::aux::yes_tag \
has_##name##_helper( \ has_##name##_helper( \
boost::mpl::aux::type_wrapper<T>* \ boost::mpl::aux::type_wrapper<T>* \
, BOOST_MSVC_TYPENAME T::name* \ , void (*)(BOOST_MSVC_TYPENAME T::name) = 0 \
); \ ); \
\ \
template< typename T > \
boost::mpl::aux::no_tag has_##name##_helper( \ boost::mpl::aux::no_tag has_##name##_helper( \
boost::mpl::aux::type_wrapper<T>* \ ... \
, ... \
); \ ); \
\ \
template< typename T > \ template< typename T > \
struct has_##name \ struct has_##name \
{ \ { \
BOOST_STATIC_CONSTANT(bool, value = \ BOOST_STATIC_CONSTANT(bool, value = \
sizeof(has_##name##_helper((boost::mpl::aux::type_wrapper<T>*)0, 0)) \ sizeof((has_##name##_helper)((boost::mpl::aux::type_wrapper<T>*)0)) \
== sizeof(boost::mpl::aux::yes_tag) \ == sizeof(boost::mpl::aux::yes_tag) \
); \ ); \
}; \ }; \