mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 14:54:30 +02:00
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:
@@ -35,20 +35,18 @@ template< typename T > \
|
||||
boost::mpl::aux::yes_tag \
|
||||
has_##name##_helper( \
|
||||
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::type_wrapper<T>* \
|
||||
, ... \
|
||||
... \
|
||||
); \
|
||||
\
|
||||
\
|
||||
template< typename T > \
|
||||
struct has_##name \
|
||||
{ \
|
||||
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) \
|
||||
); \
|
||||
}; \
|
||||
|
Reference in New Issue
Block a user