mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 14:54:30 +02:00
Changes needed to make it work when the nested type is void.
[SVN r16169]
This commit is contained in:
@@ -30,26 +30,26 @@
|
|||||||
// the implementation below is based on a USENET newsgroup's posting by
|
// 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)
|
// Rani Sharoni (comp.lang.c++.moderated, 2002-03-17 07:45:09 PST)
|
||||||
|
|
||||||
# define BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \
|
# define BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \
|
||||||
template< typename T > \
|
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>* \
|
T const volatile* \
|
||||||
, void (*)(BOOST_MSVC_TYPENAME T::name) = 0 \
|
, boost::mpl::aux::type_wrapper<BOOST_MSVC_TYPENAME T::name>* = 0 \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
boost::mpl::aux::no_tag has_##name##_helper( \
|
boost::mpl::aux::no_tag has_##name##_helper( \
|
||||||
... \
|
... \
|
||||||
); \
|
); \
|
||||||
\
|
\
|
||||||
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)) \
|
sizeof((has_##name##_helper)((T*)0)) \
|
||||||
== sizeof(boost::mpl::aux::yes_tag) \
|
== sizeof(boost::mpl::aux::yes_tag) \
|
||||||
); \
|
); \
|
||||||
}; \
|
}; \
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
Reference in New Issue
Block a user