forked from boostorg/fusion
Initial constexpr support
This allows to use, e.g., boost::fusion::fold within constexpr functions. The BOOST_CONSTEXPR macro is used to declare functions constexpr.
This commit is contained in:
@ -58,7 +58,7 @@ namespace boost { namespace fusion
|
||||
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -104,7 +104,7 @@ namespace boost { namespace fusion
|
||||
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -135,7 +135,7 @@ namespace boost { namespace fusion
|
||||
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -153,7 +153,7 @@ namespace boost { namespace fusion
|
||||
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,1>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -166,7 +166,7 @@ namespace boost { namespace fusion
|
||||
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,0>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const&, F)
|
||||
{
|
||||
@ -345,7 +345,7 @@ namespace boost { namespace fusion
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(StateRef state, Seq& seq, F f)
|
||||
{
|
||||
@ -369,7 +369,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
typedef StateRef type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static StateRef
|
||||
call(StateRef state, Seq&, F)
|
||||
{
|
||||
@ -404,7 +404,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::BOOST_FUSION_FOLD_NAME<
|
||||
Seq
|
||||
, State const
|
||||
@ -419,7 +419,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::BOOST_FUSION_FOLD_NAME<
|
||||
Seq const
|
||||
, State const
|
||||
@ -434,7 +434,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::BOOST_FUSION_FOLD_NAME<
|
||||
Seq
|
||||
, State const
|
||||
@ -449,7 +449,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::BOOST_FUSION_FOLD_NAME<
|
||||
Seq const
|
||||
, State const
|
||||
|
@ -24,7 +24,7 @@ namespace boost { namespace fusion
|
||||
struct unrolled_fold
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -65,7 +65,7 @@ namespace boost { namespace fusion
|
||||
struct unrolled_fold<Result,3>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -92,7 +92,7 @@ namespace boost { namespace fusion
|
||||
struct unrolled_fold<Result,2>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -107,7 +107,7 @@ namespace boost { namespace fusion
|
||||
struct unrolled_fold<Result,1>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const& it0,F f)
|
||||
{
|
||||
@ -119,7 +119,7 @@ namespace boost { namespace fusion
|
||||
struct unrolled_fold<Result,0>
|
||||
{
|
||||
template<typename State, typename It0, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static Result
|
||||
call(State const& state,It0 const&, F)
|
||||
{
|
||||
@ -282,7 +282,7 @@ namespace boost { namespace fusion
|
||||
, SeqSize
|
||||
>::type
|
||||
type;
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(StateRef state, Seq& seq, F f)
|
||||
{
|
||||
@ -302,7 +302,7 @@ namespace boost { namespace fusion
|
||||
struct fold_impl<0,StateRef,Seq,F>
|
||||
{
|
||||
typedef StateRef type;
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static StateRef
|
||||
call(StateRef state, Seq&, F)
|
||||
{
|
||||
@ -334,7 +334,7 @@ namespace boost { namespace fusion
|
||||
{};
|
||||
}
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq
|
||||
, State const
|
||||
@ -348,7 +348,7 @@ namespace boost { namespace fusion
|
||||
f);
|
||||
}
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq const
|
||||
, State const
|
||||
@ -362,7 +362,7 @@ namespace boost { namespace fusion
|
||||
f);
|
||||
}
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq
|
||||
, State const
|
||||
@ -376,7 +376,7 @@ namespace boost { namespace fusion
|
||||
f);
|
||||
}
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::fold<
|
||||
Seq const
|
||||
, State const
|
||||
|
@ -17,7 +17,7 @@ namespace boost { namespace fusion
|
||||
}
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result_of::fold<
|
||||
Seq
|
||||
, State const
|
||||
@ -26,7 +26,7 @@ namespace boost { namespace fusion
|
||||
fold(Seq& seq, State const& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result_of::fold<
|
||||
Seq const
|
||||
, State const
|
||||
@ -35,7 +35,7 @@ namespace boost { namespace fusion
|
||||
fold(Seq const& seq, State const& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result_of::fold<
|
||||
Seq
|
||||
, State const
|
||||
@ -44,7 +44,7 @@ namespace boost { namespace fusion
|
||||
fold(Seq& seq, State& state, F f);
|
||||
|
||||
template<typename Seq, typename State, typename F>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename result_of::fold<
|
||||
Seq const
|
||||
, State const
|
||||
|
Reference in New Issue
Block a user