Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55873 - in sandbox/SOC/2009/fusion: boost/fusion/functional/adapter boost/fusion/functional/generation boost/fusion/functional/invocation boost/fusion/functional/invocation/detail boost/fusion/functional/invocation/detail/0x boost/fusion/functional/invocation/detail/no_0x boost/fusion/support/internal libs/fusion/test/functional
From: mr.chr.schmidt_at_[hidden]
Date: 2009-08-30 09:05:12


Author: cschmidt
Date: 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
New Revision: 55873
URL: http://svn.boost.org/trac/boost/changeset/55873

Log:
functional: added data member invocation
Added:
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/small_big_type.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_function_object.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_procedure.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/limits.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused_typed.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_function_object.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_procedure.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_unfused.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/0x/invoke_impl_detail.hpp | 202 ++++++++++++++++++++++++++++++++++-----
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/no_0x/invoke.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/that_ptr.hpp | 75 ++++++++++----
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_function_object.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_procedure.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/limits.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/assert.hpp | 8 -
   sandbox/SOC/2009/fusion/libs/fusion/test/functional/invoke.cpp | 5
   19 files changed, 248 insertions(+), 73 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/adapter/detail/no_0x/fused.hpp>
 #else
 # define BOOST_FUSION_ADAPTER_NAME fused

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_function_object.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_function_object.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_function_object.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/adapter/detail/no_0x/fused_function_object.hpp>
 #elif !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
 # define BOOST_FUSION_ADAPTER_NAME fused_function_object

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_procedure.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_procedure.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/fused_procedure.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/adapter/detail/no_0x/fused_procedure.hpp>
 #elif !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
 # define BOOST_FUSION_ADAPTER_NAME fused_procedure

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/limits.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/limits.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/limits.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -12,7 +12,7 @@
 
 #include <boost/config.hpp>
 
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # include <boost/fusion/container/vector/limits.hpp>
 
 # ifndef BOOST_FUSION_UNFUSED_MAX_ARITY

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/adapter/detail/no_0x/unfused.hpp>
 #elif !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
 # include <boost/fusion/functional/adapter/detail/0x/unfused_impl.hpp>

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused_typed.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused_typed.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/adapter/unfused_typed.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_TYPED_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/adapter/detail/no_0x/unfused_typed.hpp>
 #else
 # define BOOST_FUSION_TYPED

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -10,7 +10,7 @@
 #define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # include <boost/fusion/functional/adapter/fused.hpp>
 
 # define BOOST_FUSION_CLASS_TPL_NAME fused

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_function_object.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_function_object.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_function_object.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -10,7 +10,7 @@
 #define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_FUNCTION_OBJECT_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # include <boost/fusion/functional/adapter/fused_function_object.hpp>
 
 # define BOOST_FUSION_CLASS_TPL_NAME fused_function_object

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_procedure.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_procedure.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_fused_procedure.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -10,7 +10,7 @@
 #define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_PROCEDURE_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # include <boost/fusion/functional/adapter/fused_procedure.hpp>
 
 # define BOOST_FUSION_CLASS_TPL_NAME fused_procedure

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_unfused.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_unfused.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/generation/make_unfused.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -10,7 +10,7 @@
 #define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_HPP
 
 #include <boost/config.hpp>
-# if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+# if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # include <boost/fusion/functional/adapter/unfused.hpp>
 
 # define BOOST_FUSION_CLASS_TPL_NAME unfused

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/0x/invoke_impl_detail.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/0x/invoke_impl_detail.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/0x/invoke_impl_detail.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -11,6 +11,7 @@
 #include <boost/fusion/sequence/intrinsic/size.hpp>
 #include <boost/fusion/sequence/intrinsic/empty.hpp>
 #include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/front.hpp>
 #include <boost/fusion/sequence/intrinsic/begin.hpp>
 #include <boost/fusion/iterator/deref.hpp>
 #include <boost/fusion/iterator/advance_c.hpp>
@@ -25,8 +26,15 @@
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/or.hpp>
 #include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
 #include <boost/type_traits/is_function.hpp>
 #include <boost/type_traits/is_member_function_pointer.hpp>
+#include <boost/type_traits/is_member_object_pointer.hpp>
+#include <boost/type_traits/is_member_pointer.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
 #include <boost/type_traits/remove_pointer.hpp>
 #include <boost/utility/enable_if.hpp>
 
@@ -40,9 +48,7 @@
     template<typename Result, typename F, typename... Args>
     typename
         disable_if<
- is_member_function_pointer<
- typename detail::remove_reference<F>::type
- >
+ is_member_pointer<typename remove_reference<F>::type>
           , Result
>::type
     invoke_impl_call(F&& f, Args&&... args)
@@ -58,16 +64,130 @@
>
     typename
         enable_if<
- is_member_function_pointer<
- typename detail::remove_reference<F>::type
- >
+ is_member_function_pointer<typename remove_reference<F>::type>
           , Result
>::type
     invoke_impl_call(F&& f, ClassInstance&& instance,Args&&... args)
     {
- return (that_ptr<typename detail::preevaluate<F>::gen::class_type>::
- get(std::forward<ClassInstance>(instance))->*f)(
- std::forward<Args>(args)...);
+ return (that_ptr<typename preevaluate<F>::gen::class_type>::get(
+ instance)->*f)(std::forward<Args>(args)...);
+ }
+
+ template<typename>
+ struct split_object_pointer;
+
+ template<class Type,class Class>
+ struct split_object_pointer<Type(Class::*)>
+ {
+ typedef Type type;
+ typedef Class class_type;
+ };
+
+ template<class Type,class Class>
+ struct split_object_pointer<Type(Class::* const)>
+ {
+ typedef Type type;
+ typedef Class class_type;
+ };
+
+ template<class Type,class Class>
+ struct split_object_pointer<Type(Class::* volatile)>
+ {
+ typedef Type type;
+ typedef Class class_type;
+ };
+
+ template<class Type,class Class>
+ struct split_object_pointer<Type(Class::* const volatile)>
+ {
+ typedef Type type;
+ typedef Class class_type;
+ };
+
+ template<typename ClassInstance, typename Sig>
+ struct get_object_pointer_result_type
+ {
+ typedef typename split_object_pointer<Sig>::type object_type;
+ typedef typename split_object_pointer<Sig>::class_type class_type;
+ typedef typename
+ remove_reference<ClassInstance>::type
+ nonref_class_instance;
+ typedef typename identity<ClassInstance>::type identity_class_instance;
+
+ typedef typename
+ is_base_of<
+ class_type
+ , identity_class_instance
+ >::type
+ is_directly_convertible;
+
+ typedef typename
+ mpl::if_<
+ mpl::or_<
+ is_const<object_type>
+ , mpl::and_<
+ is_directly_convertible
+ , is_const<nonref_class_instance>
+ >
+ , mpl::and_<
+ mpl::not_<is_directly_convertible>
+ , const_pointee<ClassInstance>
+ >
+ >
+ , class_type const
+ , class_type
+ >::type
+ const_class_type;
+ typedef typename
+ mpl::if_<
+ mpl::or_<
+ is_volatile<object_type>
+ , mpl::and_<
+ is_directly_convertible
+ , is_volatile<nonref_class_instance>
+ >
+ , mpl::and_<
+ mpl::not_<is_directly_convertible>
+ , volatile_pointee<ClassInstance>
+ >
+ >
+ , const_class_type volatile
+ , const_class_type
+ >::type
+ cv_class_type;
+
+ typedef typename forward_as<cv_class_type, object_type>::type type;
+ };
+
+ template<typename Sig, typename Seq>
+ struct get_object_pointer_result_type_seq
+ : get_object_pointer_result_type<
+ typename result_of::front<Seq>::type
+ , Sig
+ >
+ {};
+
+ template<
+ typename Result
+ , typename F
+ , typename ClassInstance
+ , typename... Args
+ >
+ typename
+ enable_if<
+ is_member_object_pointer<typename remove_reference<F>::type>
+ , Result
+ >::type
+ invoke_impl_call(F&& f, ClassInstance&& instance,Args&&... args)
+ {
+ BOOST_FUSION_STATIC_ASSERT(!sizeof...(Args));
+
+ return (that_ptr<
+ typename get_object_pointer_result_type<
+ ClassInstance&&
+ , typename remove_reference<F>::type
+ >::cv_class_type&
+ >::get(instance)->*f);
     }
 
     namespace bidirectional_traversal
@@ -78,12 +198,12 @@
           , bool Empty
           , typename... Args
>
- struct invoke_impl_result
+ struct invoke_impl_result_impl
         {
             typedef typename result_of::pop_back<ArgsSeq>::type new_args_seq;
 
             typedef typename
- invoke_impl_result<
+ invoke_impl_result_impl<
                     F
                   , new_args_seq
                   , result_of::empty<new_args_seq>::value
@@ -94,32 +214,46 @@
         };
 
         template<typename F, typename ArgsSeq, typename... Args>
- struct invoke_impl_result<F,ArgsSeq,true,Args...>
+ struct invoke_impl_result_impl<F,ArgsSeq,true,Args...>
           : detail::invoke_impl_result<F,Args...>
         {};
 
- template<typename F,typename Seq>
- struct invoke_impl
+ template<typename F, typename Seq>
+ struct invoke_impl_result
         {
- typedef detail::preevaluate<F> preevaluater;
+ typedef preevaluate<F> preevaluater;
 
             typedef typename
                 mpl::eval_if<
                     typename preevaluater::is_preevaluable
                   , preevaluater
- , invoke_impl_result<
+ , invoke_impl_result_impl<
                         F
                       , Seq
                       , result_of::empty<Seq>::value
>
>::type
             type;
+ };
+
+ template<typename F,typename Seq>
+ struct invoke_impl
+ {
+ typedef typename detail::remove_reference<F>::type f;
+
+ typedef typename
+ mpl::eval_if<
+ is_member_object_pointer<f>
+ , get_object_pointer_result_type_seq<f, Seq>
+ , invoke_impl_result<F, Seq>
+ >::type
+ type;
 
             template<typename LeftSeq,typename... Args>
             static type
             call_impl(F f,LeftSeq&&, mpl::true_/*SeqEmpty*/,Args&&... args)
             {
- return detail::invoke_impl_call<type>(
+ return invoke_impl_call<type>(
                         std::forward<F>(f),std::forward<Args>(args)...);
             }
 
@@ -153,8 +287,8 @@
           , int NumArgsLeft
           , typename... Args
>
- struct invoke_impl_result
- : invoke_impl_result<
+ struct invoke_impl_result_impl
+ : invoke_impl_result_impl<
                 F
               , Seq
               , NumArgsLeft-1
@@ -169,32 +303,46 @@
         {};
 
         template<typename F, typename Seq, typename... Args>
- struct invoke_impl_result<F,Seq,0,Args...>
+ struct invoke_impl_result_impl<F,Seq,0,Args...>
           : detail::invoke_impl_result<F,Args...>
         {};
 
- template<typename F,typename Seq>
- struct invoke_impl
+ template<typename F, typename Seq>
+ struct invoke_impl_result
         {
- typedef detail::preevaluate<F> preevaluater;
+ typedef preevaluate<F> preevaluater;
 
             typedef typename
                 mpl::eval_if<
                     typename preevaluater::is_preevaluable
                   , preevaluater
- , invoke_impl_result<
+ , invoke_impl_result_impl<
                         F
                       , Seq
                       , result_of::size<Seq>::value
>
>::type
             type;
+ };
+
+ template<typename F,typename Seq>
+ struct invoke_impl
+ {
+ typedef typename detail::remove_reference<F>::type f;
+
+ typedef typename
+ mpl::eval_if<
+ is_member_object_pointer<f>
+ , get_object_pointer_result_type_seq<f, Seq>
+ , invoke_impl_result<F, Seq>
+ >::type
+ type;
 
             template<typename... Args>
             static type
             call_impl(F f,Seq, mpl::int_<0>, Args&&... args)
             {
- return detail::invoke_impl_call<type>(
+ return invoke_impl_call<type>(
                         std::forward<F>(f),std::forward<Args>(args)...);
             }
 
@@ -226,8 +374,8 @@
     struct invoke_impl
       : mpl::if_<
             traits::is_bidirectional<Seq>
- , bidirectional_traversal::invoke_impl<F,Seq>
- , forward_traversal::invoke_impl<F,Seq>
+ , bidirectional_traversal::invoke_impl<F,Seq>
+ , forward_traversal::invoke_impl<F,Seq>
>::type
     {};
 }}}

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/no_0x/invoke.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/no_0x/invoke.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/no_0x/invoke.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -23,6 +23,7 @@
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/or.hpp>
+#include <boost/mpl/not.hpp>
 #include <boost/mpl/front.hpp>
 #include <boost/mpl/identity.hpp>
 
@@ -130,7 +131,7 @@
 
             typedef mpl::or_< boost::is_convertible<that,C*>,
                               boost::is_convertible<that,C&>,
- non_const_pointee<that> > non_const_cond;
+ mpl::not_<const_pointee<that> > > non_const_cond;
 
             typedef typename mpl::eval_if< non_const_cond,
                 mpl::identity<C>, add_const<C> >::type qualified_class;

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/that_ptr.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/that_ptr.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/detail/that_ptr.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,10 +9,15 @@
 #ifndef BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP
 #define BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP
 
+#include <boost/fusion/support/internal/small_big_type.hpp>
+#include <boost/fusion/support/internal/ref.hpp>
+
+#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_volatile.hpp>
 #include <boost/get_pointer.hpp>
 #include <boost/utility/addressof.hpp>
-#include <boost/type_traits/config.hpp>
-#include <boost/type_traits/remove_reference.hpp>
 
 namespace boost { namespace fusion { namespace detail
 {
@@ -59,37 +64,63 @@
         }
     };
 
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
- template <typename PtrOrSmartPtr>
- struct non_const_pointee;
-
     namespace adl_barrier
     {
         using boost::get_pointer;
- void const * BOOST_TT_DECL get_pointer(...); // fallback
+ void const* get_pointer(...);
   
- template< typename T> char const_tester(T *);
- template< typename T> long const_tester(T const *);
+ template<typename T>
+ small_type const_tester(T*);
+
+ template<typename T>
+ big_type const_tester(T const*);
 
         template <typename Ptr>
- struct non_const_pointee_impl
+ struct const_pointee_impl
         {
- static Ptr & what;
+ static Ptr* what;
 
- static bool const value =
- sizeof(const_tester(get_pointer(what))) == 1;
+ typedef
+ mpl::bool_<
+ sizeof(const_tester(get_pointer(*what)))==
+ sizeof(big_type)
+ >
+ type;
+ };
+
+ template<typename T>
+ small_type volatile_tester(T*);
+
+ template<typename T>
+ big_type volatile_tester(T volatile*);
+
+ template <typename Ptr>
+ struct volatile_pointee_impl
+ {
+ static Ptr* what;
+
+ typedef
+ mpl::bool_<
+ sizeof(volatile_tester(get_pointer(*what)))==
+ sizeof(big_type)
+ >
+ type;
         };
     }
 
- template <typename PtrOrSmartPtr> struct non_const_pointee
- : adl_barrier::non_const_pointee_impl<
- typename remove_cv<
- typename remove_reference<PtrOrSmartPtr>::type >::type >
- {
- typedef non_const_pointee type;
- typedef bool value_type;
- };
-#endif
+ template <typename PtrOrSmartPtr>
+ struct const_pointee
+ : adl_barrier::const_pointee_impl<
+ typename identity<PtrOrSmartPtr>::type
+ >::type
+ {};
+
+ template <typename PtrOrSmartPtr>
+ struct volatile_pointee
+ : adl_barrier::volatile_pointee_impl<
+ typename identity<PtrOrSmartPtr>::type
+ >::type
+ {};
 }}}
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/invocation/detail/no_0x/invoke.hpp>
 #else
 # define BOOST_FUSION_INVOKE_NAME invoke

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_function_object.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_function_object.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_function_object.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_FUNCTION_OBJECT_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/invocation/detail/no_0x/invoke_function_object.hpp>
 #elif !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
 # define BOOST_FUSION_INVOKE_NAME invoke_function_object

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_procedure.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_procedure.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/invoke_procedure.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -9,7 +9,7 @@
 #define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_PROCEDURE_HPP
 
 #include <boost/config.hpp>
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) //|| 1
 # include <boost/fusion/functional/invocation/detail/no_0x/invoke_procedure.hpp>
 #elif !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
 # define BOOST_FUSION_INVOKE_NAME invoke_procedure

Modified: sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/limits.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/limits.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/functional/invocation/limits.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -11,7 +11,7 @@
 
 #include <boost/config.hpp>
 
-#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) || 1
+#if defined(BOOST_NO_DECLTYPE) || defined(BOOST_NO_VARIADIC_TEMPLATES) || defined(BOOST_NO_RVALUE_REFERENCES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED) //|| 1
 # ifndef BOOST_FUSION_INVOKE_MAX_ARITY
 # define BOOST_FUSION_INVOKE_MAX_ARITY 6
 # endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/internal/assert.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/internal/assert.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/assert.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -29,17 +29,13 @@
 # define BOOST_FUSION_STATIC_ASSERT_MSG(PRED,MESSAGE)\
             BOOST_FUSION_STATIC_ASSERT(PRED)
 # else
+# include <boost/fusion/support/internal/small_big_type.hpp>
+
 # include <boost/preprocessor/stringize.hpp>
 # include <boost/mpl/if.hpp>
 
 namespace boost { namespace fusion { namespace detail
 {
- typedef char small_type;
- struct big_type
- {
- char data[1024];
- };
-
     template<typename Pred>
     typename mpl::if_<Pred,small_type,big_type>::type
     evaluate_pred(void(*)(Pred));

Added: sandbox/SOC/2009/fusion/boost/fusion/support/internal/small_big_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/small_big_type.hpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -0,0 +1,20 @@
+/*=============================================================================
+ Copyright (c) 2009 Christopher Schmidt
+
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_SUPPORT_INTERNAL_SMALL_BIG_TYPE_HPP
+#define BOOST_FUSION_SUPPORT_INTERNAL_SMALL_BIG_TYPE_HPP
+
+namespace boost { namespace fusion { namespace detail
+{
+ typedef char small_type;
+ struct big_type
+ {
+ char data[1024];
+ };
+}}}
+
+#endif

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/functional/invoke.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/functional/invoke.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/functional/invoke.cpp 2009-08-30 09:05:06 EDT (Sun, 30 Aug 2009)
@@ -227,8 +227,7 @@
     BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_spt_c_ctx,seq)));
 
     // Pointer to data member
- //TODO cschmidt!!!
- /*BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_obj_ctx,seq)) = that.data));
+ BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_obj_ctx,seq)) = that.data));
     BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ref_ctx,seq)) = that.data));
     BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ptr_ctx,seq)) = that.data));
     BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_spt_ctx,seq)) = that.data));
@@ -244,7 +243,7 @@
     BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_obj_c_d_ctx,seq)));
     BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ref_c_d_ctx,seq)));
     BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ptr_c_d_ctx,seq)));
- BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_spt_c_d_ctx,seq)));*/
+ BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_spt_c_d_ctx,seq)));
 }
 
 template <class Sequence>


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