Update of /cvsroot/boost/boost/boost/fusion/functional/adapter
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27343
Modified Files:
unfused_typed.hpp
Log Message:
changes semantics to contain only operator() overloads for one arity
Index: unfused_typed.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/fusion/functional/adapter/unfused_typed.hpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- unfused_typed.hpp 17 Jul 2007 21:43:14 -0000 1.11
+++ unfused_typed.hpp 22 Jul 2007 08:30:58 -0000 1.12
@@ -13,9 +13,9 @@
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
#include <boost/utility/result_of.hpp>
@@ -24,7 +24,6 @@
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/container/vector/vector.hpp>
#include <boost/fusion/sequence/conversion/as_vector.hpp>
-#include <boost/fusion/algorithm/transformation/pop_back.hpp>
#include <boost/fusion/functional/adapter/limits.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
@@ -39,7 +38,7 @@
namespace detail
{
- template <class Derived, class FunctionC, class Function,
+ template <class Derived, class Function,
class Sequence, long Arity>
struct unfused_typed_impl;
}
@@ -47,71 +46,25 @@
template <class Function, class Sequence>
class unfused_typed
: public detail::unfused_typed_impl
- < unfused_typed<Function,Sequence>, typename
detail::qf_c<Function>::type,
- typename detail::qf<Function>::type, Sequence,
result_of::size<Sequence>::value >
+ < unfused_typed<Function,Sequence>, Function, Sequence,
+ result_of::size<Sequence>::value >
{
Function fnc_transformed;
- typedef typename detail::qf_c<Function>::type function_c;
- typedef typename detail::qf<Function>::type function;
+ template <class D, class F, class S, long A>
+ friend struct detail::unfused_typed_impl;
typedef typename detail::call_param<Function>::type func_const_fwd_t;
- typedef typename detail::unfused_typed_impl<
- unfused_typed<Function,Sequence>,function_c,function,Sequence,
- result_of::size<Sequence>::value > base;
-
- template <class D, class FC, class F, class S, long A>
- friend struct detail::unfused_typed_impl;
-
public:
inline explicit unfused_typed(func_const_fwd_t f = Function())
: fnc_transformed(f)
{ }
-
- template <typename Sig>
- struct result;
};
- namespace detail
- {
- template <class Derived, class FunctionC, class Function,
- class Sequence>
- struct unfused_typed_impl<Derived,FunctionC,Function,Sequence,0>
- {
- typedef fusion::vector0 arg_vector_t;
-
- public:
-
- typedef typename boost::result_of<
- FunctionC (arg_vector_t &) > call_const_0_result;
-
- typedef typename boost::result_of<
- Function(arg_vector_t &) > call_0_result;
-
- inline typename boost::result_of<
- FunctionC (arg_vector_t &) >::type
- operator()() const
- {
- arg_vector_t arg;
- return static_cast<Derived const
*>(this)->fnc_transformed(arg);
- }
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400)
- inline typename boost::result_of<
- Function (arg_vector_t &) >::type
- operator()()
- {
- arg_vector_t arg;
- return static_cast<Derived *>(this)->fnc_transformed(arg);
- }
-#endif
- };
- }
-
#define BOOST_PP_FILENAME_1
<boost/fusion/functional/adapter/unfused_typed.hpp>
- #define BOOST_PP_ITERATION_LIMITS (1,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY)
+ #define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY)
#include BOOST_PP_ITERATE()
}}
@@ -120,11 +73,13 @@
{
template<class F, class Seq>
struct result_of< boost::fusion::unfused_typed<F,Seq> const () >
- : boost::fusion::unfused_typed<F,Seq>::call_const_0_result
+ : boost::fusion::unfused_typed<F,Seq>::template result<
+ boost::fusion::unfused_typed<F,Seq> const () >
{ };
template<class F, class Seq>
struct result_of< boost::fusion::unfused_typed<F,Seq>() >
- : boost::fusion::unfused_typed<F,Seq>::call_0_result
+ : boost::fusion::unfused_typed<F,Seq>::template result<
+ boost::fusion::unfused_typed<F,Seq> () >
{ };
}
@@ -141,71 +96,58 @@
namespace detail
{
- template <class Derived, class FunctionC, class Function,
- class Sequence>
- struct unfused_typed_impl<Derived,FunctionC,Function,Sequence,N>
- : unfused_typed_impl<Derived,FunctionC,Function,
- typename result_of::pop_back<Sequence>::type, BOOST_PP_DEC(N) >
+ template <class Derived, class Function, class Sequence>
+ struct unfused_typed_impl<Derived,Function,Sequence,N>
{
+ typedef typename detail::qf_c<Function>::type function_c;
+ typedef typename detail::qf<Function>::type function;
typedef typename result_of::as_vector<Sequence>::type arg_vector_t;
- protected:
-
- typedef typename boost::result_of<
- FunctionC(arg_vector_t &) > BOOST_PP_CAT(rc,N);
-
- typedef typename boost::result_of<
- Function(arg_vector_t &) > BOOST_PP_CAT(r,N);
-
public:
- using unfused_typed_impl< Derived,FunctionC,Function,
- typename result_of::pop_back<Sequence>::type, BOOST_PP_DEC(N)
- >::operator();
-
#define M(z,i,s)
\
typename call_param<typename result_of::value_at_c<s,i>::type>::type a##i
inline typename boost::result_of<
- FunctionC(arg_vector_t &) >::type
+ function_c(arg_vector_t &) >::type
operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const
{
+#if N > 0
arg_vector_t arg(BOOST_PP_ENUM_PARAMS(N,a));
+#else
+ arg_vector_t arg;
+#endif
return static_cast<Derived const
*>(this)->fnc_transformed(arg);
}
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400)
inline typename boost::result_of<
- Function(arg_vector_t &) >::type
+ function(arg_vector_t &) >::type
operator()(BOOST_PP_ENUM(N,M,arg_vector_t))
{
+#if N > 0
arg_vector_t arg(BOOST_PP_ENUM_PARAMS(N,a));
+#else
+ arg_vector_t arg;
+#endif
return static_cast<Derived *>(this)->fnc_transformed(arg);
}
-#endif
#undef M
- };
- } // namespace detail
+ template <typename Sig> struct result { typedef void type; };
-#if N > 0
- template <class Function, class Sequence>
- 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)
- { };
+ template <class Self BOOST_PP_ENUM_TRAILING_PARAMS(N,typename T)>
+ struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) >
+ : boost::result_of< function_c(arg_vector_t &) >
+ { };
-# 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
-#endif
+ template <class Self BOOST_PP_ENUM_TRAILING_PARAMS(N,typename T)>
+ struct result< Self (BOOST_PP_ENUM_PARAMS(N,T)) >
+ : boost::result_of< function(arg_vector_t &) >
+ { };
+ };
+
+ } // namespace detail
#undef N
#endif // defined(BOOST_PP_IS_ITERATING)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs