Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66581 - sandbox/tti/boost/tti
From: eldiener_at_[hidden]
Date: 2010-11-14 20:06:11


Author: eldiener
Date: 2010-11-14 20:06:05 EST (Sun, 14 Nov 2010)
New Revision: 66581
URL: http://svn.boost.org/trac/boost/changeset/66581

Log:
Corrected TTI_TRAIT_HAS_MEMBER to workaround VC++ and gcc 3+ bug.
Text files modified:
   sandbox/tti/boost/tti/TTIntrospection.hpp | 38 +++++++++++++++++++++++++++++++++++++-
   1 files changed, 37 insertions(+), 1 deletions(-)

Modified: sandbox/tti/boost/tti/TTIntrospection.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospection.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospection.hpp 2010-11-14 20:06:05 EST (Sun, 14 Nov 2010)
@@ -8,8 +8,14 @@
 #include <boost/mpl/identity.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/remove_const.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/variadic_macro_data/VariadicMacroData.hpp>
+#include <boost/mpl/at.hpp>
+#include <boost/mpl/quote.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/function_types/parameter_types.hpp>
+#include <boost/function_types/is_member_object_pointer.hpp>
 #include "detail/TTIntrospectionDetail.hpp"
 
 #define TTI_TRAIT_HAS_TYPE(trait,name) \
@@ -235,6 +241,36 @@
       typedef C type; \
       }; \
     \
+ template<class F> \
+ struct class_type \
+ { \
+ typedef typename \
+ boost::mpl::eval_if \
+ < \
+ boost::function_types::is_member_object_pointer<F>, \
+ class_of<F>, \
+ boost::remove_const \
+ < \
+ typename \
+ boost::mpl::at \
+ < \
+ typename \
+ boost::function_types::parameter_types \
+ < \
+ F, \
+ boost::mpl::quote1 \
+ < \
+ boost::mpl::identity \
+ > \
+ > \
+ ::type, \
+ boost::mpl::int_<0> \
+ >::type \
+ > \
+ >::type \
+ type; \
+ }; \
+ \
     template<T> \
     struct helper; \
     \
@@ -244,7 +280,7 @@
     template<class U> \
     static ::boost::type_traits::no_type check(...); \
     \
- BOOST_STATIC_CONSTANT(bool,value=sizeof(check<typename class_of<T>::type>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
+ BOOST_STATIC_CONSTANT(bool,value=sizeof(check<typename class_type<T>::type>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
     \
     typedef trait type; \
     }; \


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk