merged fusion from the trunk

[SVN r63560]
This commit is contained in:
Christopher Schmidt
2010-07-03 20:10:58 +00:00
parent 649770fdcd
commit 1572e0e9c3
402 changed files with 4874 additions and 5055 deletions

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Function> class fused;
@ -81,5 +87,9 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke_function_object.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <class Function> class fused_function_object;
@ -86,5 +92,9 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -10,10 +10,16 @@
#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
#include <boost/config.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#include <boost/fusion/functional/invocation/invoke_procedure.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Function> class fused_procedure;
@ -66,5 +72,9 @@ namespace boost { namespace fusion
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@ -17,11 +17,18 @@
#include <boost/utility/result_of.hpp>
#include <boost/config.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/functional/adapter/limits.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <class Function, bool AllowNullary = true>
@ -87,6 +94,10 @@ namespace boost { namespace fusion
};
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
namespace boost
{
template<class F>

View File

@ -28,6 +28,11 @@
#include <boost/fusion/functional/adapter/limits.hpp>
#include <boost/fusion/functional/adapter/detail/access.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -69,6 +74,10 @@ namespace boost { namespace fusion
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
namespace boost
{
template<class F, class Seq>

View File

@ -199,6 +199,8 @@ namespace boost { namespace fusion
Function(BOOST_PP_ENUM(N,M,~)) >::type result_type;
#undef M
#if N > 0
template <typename F>
static inline result_type
call(F & f, Sequence & s)
@ -206,6 +208,17 @@ namespace boost { namespace fusion
#define M(z,j,data) fusion::at_c<j>(s)
return f( BOOST_PP_ENUM(N,M,~) );
}
#else
template <typename F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
@ -245,16 +258,28 @@ namespace boost { namespace fusion
Function(BOOST_PP_ENUM_PARAMS(N,typename seq::T))
>::type result_type;
#if N > 0
template <typename F>
static inline result_type
call(F & f, Sequence & s)
{
#if N > 0
typename seq::I0 i0 = fusion::begin(s);
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#endif
return f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
template <typename F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
#if N > 0

View File

@ -118,6 +118,8 @@ namespace boost { namespace fusion
Function (BOOST_PP_ENUM(N,M,~)) >::type result_type;
#undef M
#if N > 0
template <class F>
static inline result_type
call(F & f, Sequence & s)
@ -126,6 +128,18 @@ namespace boost { namespace fusion
return f( BOOST_PP_ENUM(N,M,~) );
#undef M
}
#else
template <class F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
template <class Function, class Sequence>
@ -138,20 +152,32 @@ namespace boost { namespace fusion
Function (BOOST_PP_ENUM_PARAMS(N,typename seq::T))
>::type result_type;
#if N > 0
template <class F>
static inline result_type
call(F & f, Sequence & s)
{
#if N > 0
typename seq::I0 i0 = fusion::begin(s);
#define M(z,j,data) \
typename seq::I##j i##j = \
fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j)));
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#undef M
#endif
return f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
template <class F>
static inline result_type
call(F & f, Sequence & /*s*/)
{
return f();
}
#endif
};
template <class Sequence>

View File

@ -106,10 +106,23 @@ namespace boost { namespace fusion
template <typename Function, class Sequence>
struct invoke_procedure_impl<Function,Sequence,N,false,true>
{
#if N > 0
static inline void call(Function & f, Sequence & s)
{
f(BOOST_PP_ENUM(N,M,~));
}
#else
static inline void call(Function & f, Sequence & /*s*/)
{
f();
}
#endif
};
#if N > 0
@ -135,15 +148,25 @@ namespace boost { namespace fusion
template <typename Function, class Sequence>
struct invoke_procedure_impl<Function,Sequence,N,false,false>
{
#if N > 0
static inline void call(Function & f, Sequence & s)
{
#if N > 0
typedef typename result_of::begin<Sequence>::type I0;
I0 i0 = fusion::begin(s);
BOOST_PP_REPEAT_FROM_TO(1,N,M,~)
#endif
f( BOOST_PP_ENUM_PARAMS(N,*i) );
}
#else
static inline void call(Function & f, Sequence & /*s*/)
{
f();
}
#endif
};
#if N > 0