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

Modified Files:
        fused.hpp fused_function_object.hpp fused_procedure.hpp 
        limits.hpp unfused_generic.hpp unfused_lvalue_args.hpp 
        unfused_rvalue_args.hpp unfused_typed.hpp 
Log Message:
completes boost::result_of-based result type computation


Index: fused.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/fusion/functional/adapter/fused.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fused.hpp   11 Jun 2007 07:01:02 -0000      1.2
+++ fused.hpp   12 Jul 2007 09:07:36 -0000      1.3
@@ -35,40 +35,47 @@
         { }
 
         template <class Seq> 
-        inline typename result_of::invoke<Function,Seq const>::type 
+        inline typename result_of::invoke<func_const_fwd_t,Seq const>::type 
         operator()(Seq const & s) const
         {
-          return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
+            return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke<Function,Seq const>::type 
+        inline typename result_of::invoke<func_fwd_t,Seq const>::type 
         operator()(Seq const & s) 
         {
-          return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
+            return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke<Function,Seq>::type 
+        inline typename result_of::invoke<func_const_fwd_t,Seq>::type 
         operator()(Seq & s) const
         {
-          return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
+            return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke<Function,Seq>::type 
+        inline typename result_of::invoke<func_fwd_t,Seq>::type 
         operator()(Seq & s) 
         {
-          return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
+            return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
         }
 
-        template<typename T>
-        struct result;
+        template <typename Sig>
+        struct result
+        { };
 
-        template <typename Func, class Seq>
-        struct result<fused<Func>(Seq)>
-            : result_of::invoke<Function,Seq>
+        template <class Self, class Seq>
+        struct result< Self const (Seq) >
+            : result_of::invoke<func_const_fwd_t,Seq>
+        { };
+
+        template <class Self, class Seq>
+        struct result< Self(Seq) >
+            : result_of::invoke<func_fwd_t,Seq>
         { };
+
     };
 
 }}

Index: fused_function_object.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/fused_function_object.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fused_function_object.hpp   11 Jun 2007 07:01:02 -0000      1.2
+++ fused_function_object.hpp   12 Jul 2007 09:07:36 -0000      1.3
@@ -35,16 +35,16 @@
         { }
 
         template <class Seq> 
-        inline typename result_of::invoke_function_object<Function,Seq const
-            >::type operator()(Seq const & s) const
+        inline typename result_of::invoke_function_object<func_const_fwd_t,
+            Seq const>::type operator()(Seq const & s) const
         {
           return fusion::invoke_function_object<
               func_const_fwd_t >(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_function_object<Function,Seq const
-            >::type 
+        inline typename result_of::invoke_function_object<func_fwd_t,
+            Seq const>::type 
         operator()(Seq const & s) 
         {
           return fusion::invoke_function_object<
@@ -52,7 +52,8 @@
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_function_object<Function,Seq>::type
+        inline typename result_of::invoke_function_object<func_const_fwd_t,
+            Seq>::type
         operator()(Seq & s) const
         {
           return fusion::invoke_function_object<
@@ -60,7 +61,7 @@
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_function_object<Function,Seq>::type
+        inline typename result_of::invoke_function_object<func_fwd_t,Seq>::type
         operator()(Seq & s) 
         {
           return fusion::invoke_function_object<
@@ -68,11 +69,17 @@
         }
 
         template<typename T>
-        struct result;
+        struct result
+        { };
 
-        template <typename Seq>
-        struct result<fused_function_object(Seq)>
-            : result_of::invoke_function_object<Function, Seq>
+        template <class Self, class Seq>
+        struct result< Self const (Seq) >
+            : result_of::invoke_function_object<func_const_fwd_t, Seq>
+        { };
+
+        template <class Self, class Seq>
+        struct result< Self(Seq) >
+            : result_of::invoke_function_object<func_fwd_t, Seq>
         { };
     };
 

Index: fused_procedure.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/fused_procedure.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fused_procedure.hpp 15 Feb 2007 22:41:45 -0000      1.1
+++ fused_procedure.hpp 12 Jul 2007 09:07:36 -0000      1.2
@@ -35,43 +35,42 @@
         { }
 
         template <class Seq> 
-        inline typename result_of::invoke_procedure<Function,Seq const>::type 
-        operator()(Seq const & s) const
+        inline void operator()(Seq const & s) const
         {
-          return fusion::invoke_procedure<
-              func_const_fwd_t >(this->fnc_transformed,s);
+            fusion::invoke_procedure<
+                func_const_fwd_t >(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_procedure<Function,Seq const>::type
-        operator()(Seq const & s) 
+        inline void operator()(Seq const & s) 
         {
-          return fusion::invoke_procedure<
-              func_fwd_t >(this->fnc_transformed,s);
+            fusion::invoke_procedure<
+                func_fwd_t >(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_procedure<Function,Seq>::type 
-        operator()(Seq & s) const
+        inline void operator()(Seq & s) const
         {
-          return fusion::invoke_procedure<
-              func_const_fwd_t >(this->fnc_transformed,s);
+            fusion::invoke_procedure<
+                func_const_fwd_t >(this->fnc_transformed,s);
         }
 
         template <class Seq> 
-        inline typename result_of::invoke_procedure<Function,Seq>::type 
-        operator()(Seq & s) 
+        inline void operator()(Seq & s) 
         {
-          return fusion::invoke_procedure<
-              func_fwd_t >(this->fnc_transformed,s);
+            return fusion::invoke_procedure<
+                func_fwd_t >(this->fnc_transformed,s);
         }
 
-        template <class Seq>
+        template <typename Sig>
         struct result
-            : result_of::invoke_procedure<Function,Seq>
         { };
 
-        typedef void result_type;
+        template <class Self, class Seq>
+        struct result< Self(Seq) >
+        {
+            typedef void type;
+        };
     };
 }}
 

Index: limits.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/fusion/functional/adapter/limits.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- limits.hpp  15 Feb 2007 22:41:45 -0000      1.1
+++ limits.hpp  12 Jul 2007 09:07:36 -0000      1.2
@@ -31,6 +31,9 @@
 #   elif BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE
 #       error "BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE"
 #   endif
+#   if !defined(BOOST_FUSION_CONSTRUCTOR_MAX_ARITY)
+#       define BOOST_FUSION_CONSTRUCTOR_MAX_ARITY 6
+#   endif
 
 #endif
 

Index: unfused_generic.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/unfused_generic.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- unfused_generic.hpp 11 Jun 2007 21:09:44 -0000      1.3
+++ unfused_generic.hpp 12 Jul 2007 09:07:36 -0000      1.4
@@ -56,17 +56,23 @@
 
         using base::operator();
 
-        template <typename T>
-        struct result;
+        template <typename Sig>
+        struct result
+        { };
 
-        template <typename Func>
-        struct result<unfused_generic<Func>()>
-            : base::r0
+        template <class Self>
+        struct result< Self const () >
+            : base::call_const_0_result_class
+        { };
+
+        template <class Self>
+        struct result< Self() >
+            : base::call_0_result_class
         { };
 
         #define BOOST_FUSION_CODE(tpl_params,arg_types,params,args)            
 \
         template <tpl_params>                                                  
\
-        inline typename function::template result<function(                    
\
+        inline typename function::template result<function const (             
\
             BOOST_PP_CAT(fusion::vector,N)<arg_types>)>::type                  
\
         operator()(params) const                                               
\
         {                                                                      
\
@@ -91,16 +97,22 @@
         #define  N BOOST_PP_ITERATION_1
         #include BOOST_PP_ITERATE()
         #undef   N
+
         #undef BOOST_FUSION_CODE
     };
 }}
 
-namespace boost {
-    template<typename Func>
-    struct result_of<boost::fusion::unfused_generic<Func>()>
+namespace boost 
+{
+    template<class F>
+    struct result_of<boost::fusion::unfused_generic<F> const ()>
     {
-        typedef boost::fusion::unfused_generic<Func> function;
-        typedef typename function::template result<function()>::type type;
+        typedef typename 
boost::fusion::unfused_generic<F>::call_const_0_result type;
+    };
+    template<class F>
+    struct result_of<boost::fusion::unfused_generic<F>()>
+    {
+        typedef typename boost::fusion::unfused_generic<F>::call_0_result type;
     };
 }
 
@@ -115,9 +127,17 @@
 #include <boost/fusion/functional/adapter/detail/pt_def.hpp>
 
 #if BOOST_PP_SLOT_1() == 0 
-        template <typename Func, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
         struct result
-            <unfused_generic<Func>(BOOST_PP_ENUM_PARAMS(N,T))>
+            < Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
+            : function::template result<function const (
+                BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
+                   typename detail::gref<T,>::type BOOST_PP_INTERCEPT) >)>
+        { };
+
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        struct result
+            < Self(BOOST_PP_ENUM_PARAMS(N,T)) >
             : function::template 
result<function(BOOST_PP_CAT(fusion::vector,N)<
                 BOOST_PP_ENUM_BINARY_PARAMS(N,typename detail::gref<T,>::type
                     BOOST_PP_INTERCEPT) >)>
@@ -126,7 +146,7 @@
 
 #if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1400)) 
         template <BOOST_PP_ENUM_PARAMS(N,typename T)>
-        inline typename function::template result<function(
+        inline typename function::template result<function const(
             BOOST_PP_CAT(fusion::vector,N)<BOOST_PP_ENUM_PARAMS(N,PT)>)>::type
         operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) const
         {

Index: unfused_lvalue_args.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/unfused_lvalue_args.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- unfused_lvalue_args.hpp     11 Jun 2007 07:01:02 -0000      1.2
+++ unfused_lvalue_args.hpp     12 Jul 2007 09:07:36 -0000      1.3
@@ -55,12 +55,18 @@
 
         using base::operator();
 
-        template <typename T>
-        struct result;
+        template <typename Sig>
+        struct result
+        { };
 
-        template <typename Func>
-        struct result<unfused_lvalue_args<Func>()>
-            : base::r0
+        template <class Self>
+        struct result< Self const () >
+            : base::call_const_0_result_class
+        { };
+
+        template <class Self>
+        struct result< Self() >
+            : base::call_0_result_class
         { };
 
         #define  BOOST_PP_FILENAME_1 \
@@ -71,12 +77,17 @@
     };
 }}
 
-namespace boost {
-    template<typename Func>
-    struct result_of<boost::fusion::unfused_lvalue_args<Func>()>
+namespace boost 
+{
+    template<class F>
+    struct result_of< boost::fusion::unfused_lvalue_args<F> const () >
     {
-        typedef boost::fusion::unfused_lvalue_args<Func> function;
-        typedef typename function::template result<function()>::type type;
+        typedef typename 
boost::fusion::unfused_lvalue_args<F>::call_const_0_result type;
+    };
+    template<class F>
+    struct result_of< boost::fusion::unfused_lvalue_args<F>() >
+    {
+        typedef typename boost::fusion::unfused_lvalue_args<F>::call_0_result 
type;
     };
 }
 
@@ -89,12 +100,18 @@
 
////////////////////////////////////////////////////////////////////////////////
 #define N BOOST_PP_ITERATION()
 
-        template <typename Func, BOOST_PP_ENUM_PARAMS(N,typename T)>
-        struct result
-            <Func(BOOST_PP_ENUM_PARAMS(N,T))>
-            : function::template result< 
function(BOOST_PP_CAT(fusion::vector,N)<
-                BOOST_PP_ENUM_BINARY_PARAMS(N,typename detail::mref<T,>::type
-                    BOOST_PP_INTERCEPT) >)>
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
+            : function::template result< function const (
+                BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
+                    typename detail::mref<T,>::type BOOST_PP_INTERCEPT) >)>
+        { };
+
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        struct result< Self(BOOST_PP_ENUM_PARAMS(N,T)) >
+            : function::template result< function (
+                BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
+                    typename detail::mref<T,>::type BOOST_PP_INTERCEPT) >)>
         { };
 
         template <BOOST_PP_ENUM_PARAMS(N,typename T)>

Index: unfused_rvalue_args.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/unfused_rvalue_args.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- unfused_rvalue_args.hpp     11 Jun 2007 07:01:02 -0000      1.2
+++ unfused_rvalue_args.hpp     12 Jul 2007 09:07:36 -0000      1.3
@@ -55,12 +55,18 @@
 
         using base::operator();
 
-        template <typename T>
-        struct result;
+        template <typename Sig>
+        struct result
+        { };
 
-        template <typename Func>
-        struct result<unfused_rvalue_args<Func>()>
-            : base::r0
+        template <class Self>
+        struct result< Self const () >
+            : base::call_const_0_result_class
+        { };
+
+        template <class Self>
+        struct result< Self() >
+            : base::call_0_result_class
         { };
 
         #define  BOOST_PP_FILENAME_1 \
@@ -71,12 +77,17 @@
     };
 }}
 
-namespace boost {
-    template<typename Func>
-    struct result_of<boost::fusion::unfused_rvalue_args<Func>()>
+namespace boost 
+{
+    template<class F>
+    struct result_of<boost::fusion::unfused_rvalue_args<F> const ()>
     {
-        typedef boost::fusion::unfused_rvalue_args<Func> function;
-        typedef typename function::template result<function()>::type type;
+        typedef typename 
boost::fusion::unfused_rvalue_args<F>::call_const_0_result type;
+    };
+    template<class F>
+    struct result_of<boost::fusion::unfused_rvalue_args<F>()>
+    {
+        typedef typename boost::fusion::unfused_rvalue_args<F>::call_0_result 
type;
     };
 }
 
@@ -89,11 +100,18 @@
 
////////////////////////////////////////////////////////////////////////////////
 #define N BOOST_PP_ITERATION()
 
-        template <typename Func, BOOST_PP_ENUM_PARAMS(N,typename T)>
-        struct result<Func(BOOST_PP_ENUM_PARAMS(N,T))>
-            : function::template result<function( 
BOOST_PP_CAT(fusion::vector,N)<
-                BOOST_PP_ENUM_BINARY_PARAMS(N,typename detail::cref<T,>::type
-                    BOOST_PP_INTERCEPT) >)>
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
+            : function::template result< function const (
+                BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
+                    typename detail::cref<T,>::type BOOST_PP_INTERCEPT) >)>
+        { };
+
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+        struct result< Self (BOOST_PP_ENUM_PARAMS(N,T)) >
+            : function::template result< function (
+                BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N,
+                    typename detail::cref<T,>::type BOOST_PP_INTERCEPT) >)>
         { };
 
         template <BOOST_PP_ENUM_PARAMS(N,typename T)>

Index: unfused_typed.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/fusion/functional/adapter/unfused_typed.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- unfused_typed.hpp   11 Jun 2007 07:01:02 -0000      1.4
+++ unfused_typed.hpp   12 Jul 2007 09:07:36 -0000      1.5
@@ -104,12 +104,18 @@
             : fnc_transformed(f)
         { }
 
-        template <typename T>
-        struct result;
+        template <typename Sig>
+        struct result
+        { };
 
-        template <typename Func, typename Seq>
-        struct result<unfused_typed<Func, Seq>()>
-            : base::r0
+        template <class Self>
+        struct result< Self const () >
+            : base::call_const_0_result_class
+        { };
+
+        template <class Self>
+        struct result< Self() >
+            : base::call_0_result_class
         { };
     }; 
 
@@ -119,15 +125,21 @@
 
 }}
 
-namespace boost {
-    template<typename Func, typename Seq>
-    struct result_of<boost::fusion::unfused_typed<Func, Seq>()>
+namespace boost 
+{
+    template<class F, class Seq>
+    struct result_of< boost::fusion::unfused_typed<F,Seq> const () >
     {
-        typedef boost::fusion::unfused_typed<Func, Seq> function;
-        typedef typename function::template result<function()>::type type;
+        typedef typename 
boost::fusion::unfused_typed<F,Seq>::call_const_0_result type;
+    };
+    template<class F, class Seq>
+    struct result_of< boost::fusion::unfused_typed<F,Seq>() >
+    {
+        typedef typename boost::fusion::unfused_typed<F,Seq>::call_0_result 
type;
     };
 }
 
+
 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_TYPED_HPP_INCLUDED
 #else // defined(BOOST_PP_IS_ITERATING)
 ///////////////////////////////////////////////////////////////////////////////
@@ -149,26 +161,21 @@
                 Derived,Function,Sequence>::type base;
 
             typedef typename remove_const<typename 
remove_reference<Function>::type>::type function;
-
-            // Notes: 
-            // - conversion to fusion::vector might not be perfect (there is 
-            //   currently no "inrinsic converting ctor" that would allow us
-            //   to let the user choose the sequence implementation)
-            // - value_at_c (instead of iteration) is OK because of conversion 
-            //   to fusion::vector - we would need iteration for arbitrary 
-            //   sequences
             typedef typename result_of::as_vector<Sequence>::type arg_vector_t;
-        public:
-
-            using base::operator();
 
+        protected:
+            typedef typename function::
+                template result<function const (arg_vector_t)> 
BOOST_PP_CAT(rc,N);
             typedef typename function::
                 template result<function(arg_vector_t)> BOOST_PP_CAT(r,N);
+        public:
+
+            using base::operator();
 
 #define M(z,i,s)                                                               
 \
     typename call_param<typename result_of::value_at_c<s,i>::type>::type a##i
 
-            inline typename function::template 
result<function(arg_vector_t)>::type 
+            inline typename function::template result<function const 
(arg_vector_t)>::type 
             operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const
             {
                 arg_vector_t arg(BOOST_PP_ENUM_PARAMS(N,a));
@@ -190,11 +197,20 @@
     } // namespace detail
 
     template <class Function, class Sequence> 
-        template <typename Func, BOOST_PP_ENUM_PARAMS(N,typename T)>
-    struct unfused_typed<Function,Sequence>::result
-    <Func(BOOST_PP_ENUM_PARAMS(N,T))>
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+    struct unfused_typed<Function,Sequence>::result<
+            Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
+        : BOOST_PP_CAT(base::rc,N)
+    { };
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+    template <class Function, class Sequence> 
+        template <class Self, BOOST_PP_ENUM_PARAMS(N,typename T)>
+    struct unfused_typed<Function,Sequence>::result<
+            Self (BOOST_PP_ENUM_PARAMS(N,T)) >
         : BOOST_PP_CAT(base::r,N)
     { };
+#endif
 
 #undef N
 #endif // defined(BOOST_PP_IS_ITERATING)


-------------------------------------------------------------------------
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