Update of /cvsroot/boost/boost/boost/fusion/functional/invocation
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16454

Modified Files:
        invoke_function_object.hpp invoke_procedure.hpp 
Log Message:
adds const-correctness, simplification


Index: invoke_function_object.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/invocation/invoke_function_object.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- invoke_function_object.hpp  11 Jun 2007 07:01:03 -0000      1.3
+++ invoke_function_object.hpp  13 Jul 2007 15:12:14 -0000      1.4
@@ -79,7 +79,7 @@
         template <class Function, class Sequence> struct invoke_function_object
             : detail::invoke_function_object_impl< 
                 typename boost::remove_reference<Function>::type, Sequence
-            >::template result<>
+            >::result
         { }; 
     }
 
@@ -117,18 +117,16 @@
         {
         public:
 
-            template <typename _ = void>
             struct result
 #define M(z,j,data)                                                            
 \
     typename boost::remove_reference<                                          
\
         typename result_of::value_at_c<Sequence,j>::type >::type 
-                : boost::result_of<
-                typename remove_const<Function>::type (BOOST_PP_ENUM(N,M,~))>
+                : boost::result_of< Function (BOOST_PP_ENUM(N,M,~)) >
 #undef M
             { }; 
 
             template <class F>
-            static inline typename result<F>::type
+            static inline typename result::type
             call(F & f, Sequence & s)
             {
 #define M(z,j,data) fusion::at_c<j>(s)
@@ -143,17 +141,13 @@
         private:
             typedef invoke_function_object_param_types<Sequence,N> seq;
         public:
-            template <typename _ = void>
             struct result
-                
-            { 
-                typedef typename 
-                boost::result_of<
-                    typename remove_const<Function>::type 
(BOOST_PP_ENUM_PARAMS(N,typename seq::T))>::type type;
-            }; 
+                : boost::result_of<
+                    Function (BOOST_PP_ENUM_PARAMS(N,typename seq::T)) >
+            { }; 
 
             template <class F>
-            static inline typename result<F>::type
+            static inline typename result::type
             call(F & f, Sequence & s)
             {
 #if N > 0

Index: invoke_procedure.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/invocation/invoke_procedure.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- invoke_procedure.hpp        19 Mar 2007 18:16:21 -0000      1.2
+++ invoke_procedure.hpp        13 Jul 2007 15:12:14 -0000      1.3
@@ -19,24 +19,13 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
 
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/less.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/size_t.hpp>
-#include <boost/mpl/front.hpp>
-#include <boost/mpl/identity.hpp>
-
-#include <boost/blank.hpp>
-
 #include <boost/type_traits/remove_reference.hpp>
 
+#include <boost/mpl/front.hpp>
+
 #include <boost/function_types/is_callable_builtin.hpp>
 #include <boost/function_types/is_member_function_pointer.hpp>
 #include <boost/function_types/parameter_types.hpp>
-#include <boost/function_types/function_arity.hpp>
 
 #include <boost/fusion/support/category_of.hpp>
 #include <boost/fusion/sequence/intrinsic/at.hpp>
@@ -51,7 +40,10 @@
 {
     namespace result_of
     {
-        template <typename Function, class Sequence> struct invoke_procedure;
+        template <typename Function, class Sequence> struct invoke_procedure
+        {
+            typedef void type;
+        };
     }
 
     template <typename Function, class Sequence>
@@ -69,27 +61,10 @@
         template< 
             typename Function, class Sequence, 
             int N = result_of::size<Sequence>::value,
-            bool CBI = ft::is_callable_builtin<Function>::value,
             bool MFP = ft::is_member_function_pointer<Function>::value,
             bool RandomAccess = traits::is_random_access<Sequence>::value
             >
-        struct invoke_procedure_impl
-        {
-            typedef boost::blank result;
-        };
-
-        template <typename Func, class N, bool CBI = true>
-        // Contains void type member, empty on arity mismatch
-        struct invoke_procedure_result
-            : mpl::if_< 
-                  mpl::or_<
-                      mpl::bool_<! CBI>, 
-                      mpl::equal_to< ft::function_arity<Func>, N >,
-                      mpl::and_< ft::is_callable_builtin<Func, ft::variadic>,
-                          mpl::less< ft::function_arity<Func>, N > >
-                  >, mpl::identity<void>, boost::blank
-              >::type
-        { }; 
+        struct invoke_procedure_impl;
 
         #define  BOOST_PP_FILENAME_1 \
             <boost/fusion/functional/invocation/invoke_procedure.hpp>
@@ -99,15 +74,6 @@
 
     }
 
-    namespace result_of
-    {
-        template <typename Function, class Sequence> struct invoke_procedure
-            : detail::invoke_procedure_impl< 
-                typename boost::remove_reference<Function>::type, Sequence
-              >::result
-        { }; 
-    }
-
     template <typename Function, class Sequence>
     inline void invoke_procedure(Function f, Sequence & s)
     {
@@ -137,13 +103,9 @@
 
 #define M(z,j,data) fusion::at_c<j>(s)
 
-        template <typename Function, class Sequence, bool CBI>
-        struct invoke_procedure_impl<Function,Sequence,N,CBI,false,true>
+        template <typename Function, class Sequence>
+        struct invoke_procedure_impl<Function,Sequence,N,false,true>
         {
-            struct result
-                : invoke_procedure_result< Function, mpl::size_t<N>, CBI >
-            { }; 
-
             static inline void call(Function & f, Sequence & s)
             {
                 f(BOOST_PP_ENUM(N,M,~));
@@ -152,12 +114,8 @@
 
 #if N > 0
         template <typename Function, class Sequence>
-        struct invoke_procedure_impl<Function,Sequence,N,true,true,true>
+        struct invoke_procedure_impl<Function,Sequence,N,true,true>
         {
-            struct result
-                : invoke_procedure_result< Function, mpl::size_t<N> >
-            { }; 
-
             static inline void call(Function & f, Sequence & s)
             {
                 (that_ptr<typename mpl::front<
@@ -174,13 +132,9 @@
                 >::type I ## j ;                                               
\
             I##j i##j = fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j)));
 
-        template <typename Function, class Sequence, bool CBI>
-        struct invoke_procedure_impl<Function,Sequence,N,CBI,false,false>
+        template <typename Function, class Sequence>
+        struct invoke_procedure_impl<Function,Sequence,N,false,false>
         {
-            struct result
-                : invoke_procedure_result< Function, mpl::size_t<N>, CBI >
-            { }; 
-
             static inline void call(Function & f, Sequence & s)
             {
 #if N > 0
@@ -194,12 +148,8 @@
 
 #if N > 0
         template <typename Function, class Sequence>
-        struct invoke_procedure_impl<Function,Sequence,N,true,true,false>
+        struct invoke_procedure_impl<Function,Sequence,N,true,false>
         {
-            struct result
-                : invoke_procedure_result< Function, mpl::size_t<N> >
-            { }; 
-
             static inline void call(Function & f, Sequence & s)
             {
                 typedef typename result_of::begin<Sequence>::type I0;


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to