Merge remote-tracking branch 'official/develop' into fusion_adapters

This commit is contained in:
Damien Buhl (alias daminetreg)
2014-10-27 14:00:49 +01:00
73 changed files with 1293 additions and 451 deletions

View File

@ -53,6 +53,7 @@
[def __boost_shared_ptr_call__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]]
[def __boost_func_forward__ [@http://www.boost.org/libs/functional/forward/doc/html/index.html Boost.Functional/Forward]]
[def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]]
[def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]]
[def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]]
[def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]]
[def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]]

View File

@ -1,6 +1,7 @@
[/==============================================================================
Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (C) 2014 Christoph Weiss
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -1896,6 +1897,91 @@ compile time error.
[endsect]
[section Hashing]
Automatically create a `boost::hash` conforming `hash_value` function.
[heading Synopsis]
template <typename Seq>
std::size_t
hash_value(Seq const& seq);
[heading Parameters]
[table
[[Parameter] [Requirement] [Description]]
[[`seq`] [Instance of __sequence__] [__sequence__ to compute hash value of]]
]
[*Return type]: `std::size_t`
[*Requirements]:
For each element `e` in sequence `seq`, `hash_value(seq)` is a valid expression
returning a type that is convertible to `std::size_t`.
[*Semantics]: Returns a combined hash value for all elements of `seq`.
[heading Header]
#include <boost/fusion/sequence/hash.hpp>
#include <boost/fusion/include/hash.hpp>
[heading Example]
#include <boost/fusion/include/equal_to.hpp>
#include <boost/fusion/include/hash.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/unordered_map.hpp>
void foo()
{
typedef boost::fusion::vector<int, std::string, char> Vec;
const Vec v = {42, "Hello World", 't'};
// Compute a hash value directly.
std::cout << "hash_value(v) = " << boost::fusion::hash_value(v) << '\n';
// Or use it to create an unordered_map.
boost::unordered_map<Vec, bool> map;
map[v] = true;
assert(map.size() == 1 && map.count(v) == 1);
}
[heading Example]
#include <boost/fusion/include/define_struct.hpp>
#include <boost/fusion/include/equal_to.hpp>
#include <boost/fusion/include/hash.hpp>
#include <boost/unordered_set.hpp>
// We would like to define a struct that we can form unordered_sets of.
BOOST_FUSION_DEFINE_STRUCT(
(demo), Key,
(bool, b)
(std::string, s)
(int, i)
)
namespace demo {
// Make operator== and hash_value ADL accessible.
using boost::fusion::operator==;
using boost::fusion::hash_value;
typedef boost::unordered_set<demo::Key> Set;
}
void foo()
{
demo::Set set;
demo::Key key;
assert(set.count(key) == 0);
}
[heading See also]
__boost_func_hash__
[endsect]
[endsect]
[endsect]

View File

@ -17,5 +17,7 @@
#include <boost/fusion/adapted/boost_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/mpl/clear.hpp>
#endif

View File

@ -0,0 +1,59 @@
/*=============================================================================
Copyright (c) 2012-2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BUILD_CONS_10172012_0130)
#define BOOST_FUSION_BUILD_CONS_10172012_0130
#include <boost/tuple/tuple.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/deref.hpp>
namespace boost { namespace fusion { namespace detail
{
template <
typename First
, typename Last
, bool is_empty = result_of::equal_to<First, Last>::value>
struct build_tuple_cons;
template <typename First, typename Last>
struct build_tuple_cons<First, Last, true>
{
typedef boost::tuples::null_type type;
BOOST_FUSION_GPU_ENABLED
static type
call(First const&, Last const&)
{
return type();
}
};
template <typename First, typename Last>
struct build_tuple_cons<First, Last, false>
{
typedef
build_tuple_cons<typename result_of::next<First>::type, Last>
next_build_tuple_cons;
typedef boost::tuples::cons<
typename result_of::value_of<First>::type
, typename next_build_tuple_cons::type>
type;
BOOST_FUSION_GPU_ENABLED
static type
call(First const& f, Last const& l)
{
typename result_of::value_of<First>::type v = *f;
return type(v, next_build_tuple_cons::call(fusion::next(f), l));
}
};
}}}
#endif

View File

@ -0,0 +1,50 @@
/*=============================================================================
Copyright (c) 2012-2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0120)
#define BOOST_FUSION_CONVERT_IMPL_10172012_0120
#include <boost/tuple/tuple.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/build_cons.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template <typename T>
struct convert_impl;
template <>
struct convert_impl<boost_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef typename
detail::build_tuple_cons<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
>
build_tuple_cons;
typedef typename build_tuple_cons::type type;
BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& seq)
{
return build_tuple_cons::call(fusion::begin(seq), fusion::end(seq));
}
};
};
}
}}
#endif

View File

@ -0,0 +1,23 @@
/*=============================================================================
Copyright (c) 2012 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_CLEAR_10172012_0100)
#define BOOST_FUSION_CLEAR_10172012_0100
#include <boost/mpl/identity.hpp>
#include <boost/fusion/adapted/boost_tuple/tag_of.hpp>
namespace boost { namespace fusion { namespace detail {
template <typename Tag>
struct clear;
template <>
struct clear<boost_tuple_tag> : mpl::identity<boost::tuple<> > {};
}}}
#endif

View File

@ -28,7 +28,7 @@ namespace boost { namespace fusion
{
typedef typename mpl::at<Sequence, N>::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{

View File

@ -33,7 +33,7 @@ namespace boost { namespace fusion {
>::type iterator;
typedef mpl_iterator<iterator> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{

View File

@ -33,7 +33,7 @@ namespace boost { namespace fusion
>::type iterator;
typedef mpl_iterator<iterator> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{

View File

@ -38,7 +38,7 @@ namespace boost { namespace fusion
typename Iterator::iterator_type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@ -53,7 +53,7 @@ namespace boost { namespace fusion
typename mpl::next<typename Iterator::iterator_type>::type>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@ -68,7 +68,7 @@ namespace boost { namespace fusion
typename mpl::prior<typename Iterator::iterator_type>::type>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@ -83,7 +83,7 @@ namespace boost { namespace fusion
typename mpl::advance<typename Iterator::iterator_type, N>::type>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& /*i*/)
{
@ -104,7 +104,7 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I1 const&, I2 const&)
{

View File

@ -16,7 +16,9 @@
#include <boost/fusion/adapted/std_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/convert_impl.hpp>
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
#include <boost/fusion/adapted/std_tuple/mpl/clear.hpp>
#endif

View File

@ -0,0 +1,105 @@
/*=============================================================================
Copyright (c) 2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_BUILD_STD_TUPLE_05292014_0100)
#define BOOST_FUSION_BUILD_STD_TUPLE_05292014_0100
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <tuple>
namespace boost { namespace fusion { namespace detail
{
template <typename First, typename Last
, bool is_empty = result_of::equal_to<First, Last>::value
>
struct build_std_tuple;
template <typename First, typename Last>
struct build_std_tuple<First, Last, true>
{
typedef std::tuple<> type;
BOOST_FUSION_GPU_ENABLED
static type
call(First const&, Last const&)
{
return type();
}
};
template <int ...> struct indexed_tuple { };
template <int, typename = indexed_tuple<>>
struct make_indexed_tuple;
template <int Head, int ...Tail>
struct make_indexed_tuple<Head, indexed_tuple<Tail...>>
{
typedef typename
boost::mpl::eval_if_c<
(Head == 0),
boost::mpl::identity<indexed_tuple<Tail...>>,
make_indexed_tuple<Head - 1, indexed_tuple<Head - 1, Tail...>>
>::type
type;
};
template <typename T, typename Rest>
struct push_front_std_tuple;
template <typename T, typename ...Rest>
struct push_front_std_tuple<T, std::tuple<Rest...>>
{
typedef std::tuple<T, Rest...> type;
template <int ...I>
BOOST_FUSION_GPU_ENABLED
static type
indexed_call(T const& first, std::tuple<Rest...> const& rest, indexed_tuple<I...>)
{
return type(first, std::get<I>(rest)...);
}
BOOST_FUSION_GPU_ENABLED
static type
call(T const& first, std::tuple<Rest...> const& rest)
{
typedef typename make_indexed_tuple<sizeof...(Rest)>::type gen;
return indexed_call(first, rest, gen());
}
};
template <typename First, typename Last>
struct build_std_tuple<First, Last, false>
{
typedef
build_std_tuple<typename result_of::next<First>::type, Last>
next_build_std_tuple;
typedef push_front_std_tuple<
typename result_of::value_of<First>::type
, typename next_build_std_tuple::type>
push_front;
typedef typename push_front::type type;
BOOST_FUSION_GPU_ENABLED
static type
call(First const& f, Last const& l)
{
typename result_of::value_of<First>::type v = *f;
return push_front::call(
v, next_build_std_tuple::call(fusion::next(f), l));
}
};
}}}
#endif

View File

@ -0,0 +1,48 @@
/*=============================================================================
Copyright (c) 2012-2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0940)
#define BOOST_FUSION_CONVERT_IMPL_10172012_0940
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template <typename T>
struct convert_impl;
template <>
struct convert_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef detail::build_std_tuple<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type
> gen;
typedef typename gen::type type;
BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& seq)
{
return gen::call(begin(seq), end(seq));
}
};
};
}
}}
#endif

View File

@ -0,0 +1,23 @@
/*=============================================================================
Copyright (c) 2012 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_CLEAR_10172012_0940)
#define BOOST_FUSION_CLEAR_10172012_0940
#include <boost/mpl/identity.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Tag>
struct clear;
template <>
struct clear<std_tuple_tag> : mpl::identity<std::tuple<> > {};
}}}
#endif

View File

@ -47,7 +47,7 @@ namespace boost { namespace fusion
{
template<typename State, typename It, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)
: boost::result_of<
: fusion::detail::result_of_with_decltype<
F(
typename add_reference<typename add_const<State>::type>::type,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It))
@ -57,39 +57,11 @@ namespace boost { namespace fusion
template<typename Result,int N>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)
{
template<typename State, typename It0, typename F>
BOOST_FUSION_GPU_ENABLED
template<typename State3, typename It3, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
call_3(State3 const& state3,It3 const& it3,F& f)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It2
>::type
It3;
It3 it3 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2);
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2;
State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State2,It2,F>::type State3;
State3 const state3=f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2));
return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
Result
, N-4
@ -98,54 +70,95 @@ namespace boost { namespace fusion
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it3),
f);
}
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return call_3(
f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2),
f);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1),
f);
}
template<typename State, typename It0, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
{
return call_1(
f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0),
f);
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3>
{
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2));
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1),
f);
}
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)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2;
State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1));
return f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2));
return call_1(
f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0),
f);
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2>
{
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1));
}
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)
{
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
return f(
state1,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0)));
return call_1(
f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0),
f);
}
};
@ -153,7 +166,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 +179,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)
{
@ -314,7 +327,7 @@ namespace boost { namespace fusion
{
typedef typename
BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
typename boost::result_of<
typename fusion::detail::result_of_with_decltype<
F(
StateRef,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(
@ -345,7 +358,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 +382,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 +417,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 +432,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 +447,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 +462,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

View File

@ -14,7 +14,7 @@ namespace boost { namespace fusion
{
template<typename State, typename It, typename F>
struct fold_lvalue_state
: boost::result_of<
: fusion::detail::result_of_with_decltype<
F(
typename add_reference<typename add_const<State>::type>::type,
typename fusion::result_of::deref<It>::type)
@ -23,35 +23,11 @@ namespace boost { namespace fusion
template<typename Result,int N>
struct unrolled_fold
{
template<typename State, typename It0, typename F>
BOOST_FUSION_GPU_ENABLED
template<typename State3, typename It3, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
call_3(State3 const& state3,It3 const& it3,F& f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename
result_of::next<
It2
>::type
It3;
It3 it3 = fusion::next(it2);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
typedef typename fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,fusion::deref(it2));
return unrolled_fold<
Result
, N-4
@ -60,54 +36,94 @@ namespace boost { namespace fusion
fusion::next(it3),
f);
}
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return call_3(
f(state2,fusion::deref(it2)),
fusion::next(it2),
f);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,fusion::deref(it1)),
fusion::next(it1),
f);
}
template<typename State, typename It0, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
{
return call_1(
f(state,fusion::deref(it0)),
fusion::next(it0),
f);
}
};
template<typename Result>
struct unrolled_fold<Result,3>
{
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return f(state2,fusion::deref(it2));
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,fusion::deref(it1)),
fusion::next(it1),
f);
}
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)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
return f(state2,fusion::deref(it2));
return call_1(
f(state,fusion::deref(it0)),
fusion::next(it0),
f);
}
};
template<typename Result>
struct unrolled_fold<Result,2>
{
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return f(state1,fusion::deref(it1));
}
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)
{
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
return f(
state1,
fusion::deref( fusion::next(it0)));
return call_1(
f(state,fusion::deref(it0)),
fusion::next(it0),
f);
}
};
template<typename Result>
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 +135,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)
{
@ -257,7 +273,7 @@ namespace boost { namespace fusion
{
typedef typename
result_of_unrolled_fold<
typename boost::result_of<
typename fusion::detail::result_of_with_decltype<
F(
StateRef,
typename fusion::result_of::deref< It0 const>::type
@ -282,7 +298,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 +318,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 +350,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 +364,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 +378,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 +392,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

View File

@ -22,35 +22,11 @@ namespace boost { namespace fusion
template<typename Result,int N>
struct unrolled_iter_fold
{
template<typename State, typename It0, typename F>
BOOST_FUSION_GPU_ENABLED
template<typename State3, typename It3, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
call_3(State3 const& state3,It3 const& it3,F& f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename
result_of::next<
It2
>::type
It3;
It3 it3 = fusion::next(it2);
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
typedef typename iter_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,it2);
return unrolled_iter_fold<
Result
, N-4
@ -59,54 +35,94 @@ namespace boost { namespace fusion
fusion::next(it3),
f);
}
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return call_3(
f(state2,it2),
fusion::next(it2),
f);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,it1),
fusion::next(it1),
f);
}
template<typename State, typename It0, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
{
return call_1(
f(state,it0),
fusion::next(it0),
f);
}
};
template<typename Result>
struct unrolled_iter_fold<Result,3>
{
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return f(state2,it2);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,it1),
fusion::next(it1),
f);
}
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)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
return f(state2,it2);
return call_1(
f(state,it0),
fusion::next(it0),
f);
}
};
template<typename Result>
struct unrolled_iter_fold<Result,2>
{
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return f(state1,it1);
}
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)
{
typedef typename iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
return f(
state1,
fusion::next(it0));
return call_1(
f(state,it0),
fusion::next(it0),
f);
}
};
template<typename Result>
struct unrolled_iter_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)
{
@ -118,7 +134,7 @@ namespace boost { namespace fusion
struct unrolled_iter_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)
{
@ -281,7 +297,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)
{
@ -301,7 +317,7 @@ namespace boost { namespace fusion
struct iter_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)
{
@ -333,7 +349,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::iter_fold<
Seq
, State const
@ -347,7 +363,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::iter_fold<
Seq const
, State const
@ -361,7 +377,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::iter_fold<
Seq
, State const
@ -375,7 +391,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::iter_fold<
Seq const
, State const

View File

@ -22,35 +22,11 @@ namespace boost { namespace fusion
template<typename Result,int N>
struct unrolled_reverse_fold
{
template<typename State, typename It0, typename F>
BOOST_FUSION_GPU_ENABLED
template<typename State3, typename It3, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
call_3(State3 const& state3,It3 const& it3,F& f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename
result_of::prior<
It2
>::type
It3;
It3 it3 = fusion::prior(it2);
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename reverse_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
typedef typename reverse_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,fusion::deref(it2));
return unrolled_reverse_fold<
Result
, N-4
@ -59,54 +35,94 @@ namespace boost { namespace fusion
fusion::prior(it3),
f);
}
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return call_3(
f(state2,fusion::deref(it2)),
fusion::prior(it2),
f);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,fusion::deref(it1)),
fusion::prior(it1),
f);
}
template<typename State, typename It0, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
{
return call_1(
f(state,fusion::deref(it0)),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,3>
{
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return f(state2,fusion::deref(it2));
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,fusion::deref(it1)),
fusion::prior(it1),
f);
}
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)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename reverse_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
return f(state2,fusion::deref(it2));
return call_1(
f(state,fusion::deref(it0)),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_fold<Result,2>
{
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return f(state1,fusion::deref(it1));
}
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)
{
typedef typename reverse_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
return f(
state1,
fusion::deref( fusion::prior(it0)));
return call_1(
f(state,fusion::deref(it0)),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_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)
{
@ -118,7 +134,7 @@ namespace boost { namespace fusion
struct unrolled_reverse_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)
{
@ -281,7 +297,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)
{
@ -301,7 +317,7 @@ namespace boost { namespace fusion
struct reverse_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)
{
@ -333,7 +349,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::reverse_fold<
Seq
, State const
@ -347,7 +363,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::reverse_fold<
Seq const
, State const
@ -361,7 +377,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::reverse_fold<
Seq
, State const
@ -375,7 +391,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::reverse_fold<
Seq const
, State const

View File

@ -22,35 +22,11 @@ namespace boost { namespace fusion
template<typename Result,int N>
struct unrolled_reverse_iter_fold
{
template<typename State, typename It0, typename F>
BOOST_FUSION_GPU_ENABLED
template<typename State3, typename It3, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
call_3(State3 const& state3,It3 const& it3,F& f)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename
result_of::prior<
It2
>::type
It3;
It3 it3 = fusion::prior(it2);
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename reverse_iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
typedef typename reverse_iter_fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,it2);
return unrolled_reverse_iter_fold<
Result
, N-4
@ -59,54 +35,94 @@ namespace boost { namespace fusion
fusion::prior(it3),
f);
}
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return call_3(
f(state2,it2),
fusion::prior(it2),
f);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,it1),
fusion::prior(it1),
f);
}
template<typename State, typename It0, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call(State const& state,It0 const& it0,F f)
{
return call_1(
f(state,it0),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,3>
{
template<typename State2, typename It2, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_2(State2 const& state2,It2 const& it2,F& f)
{
return f(state2,it2);
}
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return call_2(
f(state1,it1),
fusion::prior(it1),
f);
}
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)
{
typedef typename
result_of::prior<
It0 const
>::type
It1;
It1 it1 = fusion::prior(it0);
typedef typename
result_of::prior<
It1
>::type
It2;
It2 it2 = fusion::prior(it1);
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
typedef typename reverse_iter_fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,it1);
return f(state2,it2);
return call_1(
f(state,it0),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_iter_fold<Result,2>
{
template<typename State1, typename It1, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static Result
call_1(State1 const& state1,It1 const& it1,F& f)
{
return f(state1,it1);
}
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)
{
typedef typename reverse_iter_fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,it0);
return f(
state1,
fusion::prior(it0));
return call_1(
f(state,it0),
fusion::prior(it0),
f);
}
};
template<typename Result>
struct unrolled_reverse_iter_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)
{
@ -118,7 +134,7 @@ namespace boost { namespace fusion
struct unrolled_reverse_iter_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)
{
@ -281,7 +297,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)
{
@ -301,7 +317,7 @@ namespace boost { namespace fusion
struct reverse_iter_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)
{
@ -333,7 +349,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::reverse_iter_fold<
Seq
, State const
@ -347,7 +363,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::reverse_iter_fold<
Seq const
, State const
@ -361,7 +377,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::reverse_iter_fold<
Seq
, State const
@ -375,7 +391,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::reverse_iter_fold<
Seq const
, State const

View File

@ -10,6 +10,7 @@
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/result_of.hpp>
#include <boost/fusion/algorithm/iteration/fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>

View File

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

View File

@ -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::iter_fold<
Seq
, State const
@ -26,7 +26,7 @@ namespace boost { namespace fusion
iter_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::iter_fold<
Seq const
, State const
@ -35,7 +35,7 @@ namespace boost { namespace fusion
iter_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::iter_fold<
Seq
, State const
@ -44,7 +44,7 @@ namespace boost { namespace fusion
iter_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::iter_fold<
Seq const
, State const

View File

@ -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::reverse_fold<
Seq
, State const
@ -26,7 +26,7 @@ namespace boost { namespace fusion
reverse_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::reverse_fold<
Seq const
, State const
@ -35,7 +35,7 @@ namespace boost { namespace fusion
reverse_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::reverse_fold<
Seq
, State const
@ -44,7 +44,7 @@ namespace boost { namespace fusion
reverse_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::reverse_fold<
Seq const
, State const

View File

@ -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::reverse_iter_fold<
Seq
, State const
@ -26,7 +26,7 @@ namespace boost { namespace fusion
reverse_iter_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::reverse_iter_fold<
Seq const
, State const
@ -35,7 +35,7 @@ namespace boost { namespace fusion
reverse_iter_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::reverse_iter_fold<
Seq
, State const
@ -44,7 +44,7 @@ namespace boost { namespace fusion
reverse_iter_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::reverse_iter_fold<
Seq const
, State const

View File

@ -52,10 +52,12 @@
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Function, class Sequence> struct invoke;
}
//~ namespace result_of
//~ {
//~ template <typename Function, class Sequence,
//~ class Enable = unspecified>
//~ struct invoke;
//~ }
//~ template <typename Function, class Sequence>
//~ inline typename result_of::invoke<Function, Sequence>::type
@ -71,11 +73,14 @@ namespace boost { namespace fusion
{
namespace ft = function_types;
template <typename, typename T = void> struct always_void_ { typedef T type; };
template<
typename Function, class Sequence,
int N = result_of::size<Sequence>::value,
bool CBI = ft::is_callable_builtin<Function>::value,
bool RandomAccess = traits::is_random_access<Sequence>::value
bool RandomAccess = traits::is_random_access<Sequence>::value,
typename Enable = void
>
struct invoke_impl;
@ -104,16 +109,16 @@ namespace boost { namespace fusion
Sequence, N, RandomAccess >
{ };
template <typename Function, class Sequence, int N, bool RandomAccess>
struct invoke_impl<Function,Sequence,N,true,RandomAccess>
template <typename Function, class Sequence, int N, bool RandomAccess, typename Enable>
struct invoke_impl<Function,Sequence,N,true,RandomAccess,Enable>
: mpl::if_< ft::is_member_function_pointer<Function>,
invoke_mem_fn<Function,Sequence,N,RandomAccess>,
invoke_nonmember_builtin<Function,Sequence,N,RandomAccess>
>::type
{ };
template <typename Function, class Sequence, bool RandomAccess>
struct invoke_impl<Function,Sequence,1,true,RandomAccess>
template <typename Function, class Sequence, bool RandomAccess, typename Enable>
struct invoke_impl<Function,Sequence,1,true,RandomAccess,Enable>
: mpl::eval_if< ft::is_member_pointer<Function>,
mpl::if_< ft::is_member_function_pointer<Function>,
invoke_mem_fn<Function,Sequence,1,RandomAccess>,
@ -156,11 +161,14 @@ namespace boost { namespace fusion
namespace result_of
{
template <typename Function, class Sequence> struct invoke
template <typename Function, class Sequence,
class Enable =
typename detail::invoke_impl<
typename boost::remove_reference<Function>::type, Sequence
>::result_type>
struct invoke
{
typedef typename detail::invoke_impl<
typename boost::remove_reference<Function>::type, Sequence
>::result_type type;
typedef Enable type;
};
}
@ -195,13 +203,17 @@ namespace boost { namespace fusion
///////////////////////////////////////////////////////////////////////////////
#define N BOOST_PP_ITERATION()
#define M(z,j,data) typename result_of::at_c<Sequence,j>::type
template <typename Function, class Sequence>
struct invoke_impl<Function,Sequence,N,false,true>
struct invoke_impl<Function,Sequence,N,false,true,
typename always_void_<
typename boost::result_of<Function(BOOST_PP_ENUM(N,M,~)) >::type
>::type>
{
public:
typedef typename boost::result_of<
#define M(z,j,data) typename result_of::at_c<Sequence,j>::type
Function(BOOST_PP_ENUM(N,M,~)) >::type result_type;
#undef M
@ -288,7 +300,12 @@ namespace boost { namespace fusion
fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j)));
template <typename Function, class Sequence>
struct invoke_impl<Function,Sequence,N,false,false>
struct invoke_impl<Function,Sequence,N,false,false,
typename always_void_<
#define L(z,j,data) typename invoke_param_types<Sequence,N>::BOOST_PP_CAT(T, j)
typename boost::result_of<Function(BOOST_PP_ENUM(N,L,~))>::type
>::type>
#undef L
{
private:
typedef invoke_param_types<Sequence,N> seq;

View File

@ -0,0 +1,12 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_INCLUDE_HASH)
#define FUSION_INCLUDE_HASH
#include <boost/fusion/sequence/hash.hpp>
#endif

View File

@ -75,7 +75,7 @@ namespace boost { namespace fusion
}
template <int N, typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::advance_c<Iterator, N>::type const
advance_c(Iterator const& i)
{
@ -83,7 +83,7 @@ namespace boost { namespace fusion
}
template<typename N, typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::advance<Iterator, N>::type const
advance(Iterator const& i)
{

View File

@ -77,7 +77,7 @@ namespace boost { namespace fusion
basic_iterator<Tag, Category, Seq, Index + N::value>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(It const& it)
{
@ -100,7 +100,7 @@ namespace boost { namespace fusion
{
typedef mpl::minus<typename It2::index, typename It1::index> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static
type
call(It1 const&, It2 const&)
@ -121,18 +121,18 @@ namespace boost { namespace fusion
{};
template<typename OtherSeq>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
: seq(it.seq)
{}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator(Seq& in_seq, int)
: seq(&in_seq)
{}
template<typename OtherSeq>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
basic_iterator&
operator=(basic_iterator<Tag,Category,OtherSeq,Index> const& it)
{

View File

@ -55,7 +55,7 @@ namespace boost { namespace fusion
}
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::deref<Iterator>::type
deref(Iterator const& i)
{
@ -64,7 +64,7 @@ namespace boost { namespace fusion
}
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::deref<Iterator>::type
operator*(iterator_base<Iterator> const& i)
{

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
}
template <typename It>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::deref_data<It>::type
deref_data(It const& it)
{

View File

@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail
result_of::deref<typename Iterator::first_type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{

View File

@ -45,7 +45,7 @@ namespace boost { namespace fusion { namespace advance_detail
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type const&
call(type const& i)
{
@ -53,7 +53,7 @@ namespace boost { namespace fusion { namespace advance_detail
}
template <typename I>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I const& i)
{
@ -86,7 +86,7 @@ namespace boost { namespace fusion { namespace advance_detail
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type const&
call(type const& i)
{
@ -94,7 +94,7 @@ namespace boost { namespace fusion { namespace advance_detail
}
template <typename I>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I const& i)
{

View File

@ -53,7 +53,7 @@ namespace boost { namespace fusion { namespace distance_detail
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(First const&, Last const&)
{

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion { namespace detail
typedef Sequence sequence_type;
sequence_type sequence;
BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segment_sequence(Sequence const & seq)
: sequence(seq)
{}
};
@ -61,7 +61,7 @@ namespace extension
{
typedef typename Sequence::sequence_type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence & seq)
{
return seq.sequence;

View File

@ -35,7 +35,7 @@ namespace boost { namespace fusion
struct segmented_iterator
: iterator_facade<segmented_iterator<Context>, forward_traversal_tag>
{
BOOST_FUSION_GPU_ENABLED explicit segmented_iterator(Context const& ctx)
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_iterator(Context const& ctx)
: context(ctx)
{}
@ -52,7 +52,7 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return *it.context.car.first;
@ -72,7 +72,7 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return fusion::deref_data(it.context.car.first);
@ -132,7 +132,7 @@ namespace boost { namespace fusion
typedef detail::segmented_next_impl<typename It::context_type> impl;
typedef segmented_iterator<typename impl::type> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(It const& it)
{
return type(impl::call(it.context));

View File

@ -65,7 +65,7 @@ namespace boost { namespace fusion
cons<car_type, typename Stack::cdr_type>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return type(
@ -98,7 +98,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse<typename Stack::cdr_type> impl;
typedef typename impl::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack.cdr);
@ -112,7 +112,7 @@ namespace boost { namespace fusion
typedef iterator_range<end_type, end_type> range_type;
typedef cons<range_type> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return type(range_type(stack.car.last, stack.car.last));
@ -147,7 +147,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse3<Stack> impl;
typedef typename impl::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack);
@ -159,7 +159,7 @@ namespace boost { namespace fusion
{
typedef Result type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return segmented_begin_impl<Sequence, Stack>::call(*stack.car.first, stack);
@ -185,7 +185,7 @@ namespace boost { namespace fusion
typename segmented_next_impl_recurse<typename Stack::cdr_type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const& stack)
{
return segmented_next_impl_recurse<typename Stack::cdr_type>::call(stack.cdr);
@ -197,7 +197,7 @@ namespace boost { namespace fusion
{
typedef Next type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return pop_front_car<Stack>::call(stack);
@ -210,7 +210,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse2<Next> impl;
typedef typename impl::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(pop_front_car<Stack>::call(stack));
@ -236,7 +236,7 @@ namespace boost { namespace fusion
typedef segmented_next_impl_recurse<typename Stack::cdr_type> impl;
typedef typename impl::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return impl::call(stack.cdr);
@ -248,7 +248,7 @@ namespace boost { namespace fusion
{
typedef Next type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Stack const & stack)
{
return pop_front_car<Stack>::call(stack);

View File

@ -69,7 +69,7 @@ namespace boost { namespace fusion
}
template <typename First, typename Last>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::distance<First, Last>::type
distance(First const& a, Last const& b)
{

View File

@ -74,7 +74,7 @@ namespace boost { namespace fusion
namespace iterator_operators
{
template <typename Iter1, typename Iter2>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
boost::enable_if<
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >
@ -86,7 +86,7 @@ namespace boost { namespace fusion
}
template <typename Iter1, typename Iter2>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
boost::enable_if<
mpl::and_<is_fusion_iterator<Iter1>, is_fusion_iterator<Iter2> >

View File

@ -24,7 +24,7 @@ namespace boost { namespace fusion
iterator_base_type;
iterator_base_type iterator_base;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
iterator_adapter(iterator_base_type const& iterator_base_)
: iterator_base(iterator_base_) {}
@ -47,7 +47,7 @@ namespace boost { namespace fusion
>::type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& it)
{
@ -82,7 +82,7 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& it)
{
@ -100,7 +100,7 @@ namespace boost { namespace fusion
>::type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
@ -118,7 +118,7 @@ namespace boost { namespace fusion
>::type>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{

View File

@ -31,21 +31,21 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static T const&
call(T const& x, mpl::true_)
{
return x;
}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static mpl_iterator<T>
call(T const& /*x*/, mpl::false_)
{
return mpl_iterator<T>();
}
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename
mpl::if_<
is_fusion_iterator<T>

View File

@ -54,7 +54,7 @@ namespace boost { namespace fusion
}
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::next<Iterator>::type const
next(Iterator const& i)
{

View File

@ -54,7 +54,7 @@ namespace boost { namespace fusion
}
template <typename Iterator>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::prior<Iterator>::type const
prior(Iterator const& i)
{

View File

@ -0,0 +1,42 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_HASH_23072014_1017)
#define FUSION_HASH_23072014_1017
#include <boost/functional/hash.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost { namespace fusion
{
namespace hashing
{
struct hash_combine_fold
{
typedef std::size_t result_type;
template<typename T>
inline std::size_t operator()(std::size_t seed, T const& v)
{
boost::hash_combine(seed, v);
return seed;
}
};
template <typename Seq>
inline typename
boost::enable_if<traits::is_sequence<Seq>, std::size_t>::type
hash_value(Seq const& seq)
{
return fold(seq, 0, hash_combine_fold());
}
}
using hashing::hash_value;
}}
#endif

View File

@ -72,7 +72,7 @@ namespace boost { namespace fusion
template <typename N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@ -84,7 +84,7 @@ namespace boost { namespace fusion
}
template <typename N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at<Sequence const, N>::type
at(Sequence const& seq)
{
@ -92,7 +92,7 @@ namespace boost { namespace fusion
}
template <int N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@ -104,7 +104,7 @@ namespace boost { namespace fusion
}
template <int N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_c<Sequence const, N>::type
at_c(Sequence const& seq)
{

View File

@ -38,7 +38,7 @@ namespace boost { namespace fusion
>::type
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
@ -74,7 +74,7 @@ namespace boost { namespace fusion
}
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@ -86,7 +86,7 @@ namespace boost { namespace fusion
}
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_key<Sequence const, Key>::type
at_key(Sequence const& seq)
{

View File

@ -27,7 +27,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::back<Sequence>::type
back(Sequence& seq)
{
@ -35,7 +35,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::back<Sequence const>::type
back(Sequence const& seq)
{

View File

@ -71,7 +71,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -83,7 +83,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_enable_if<
traits::is_sequence<Sequence>

View File

@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail
>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq)
{
return type(

View File

@ -38,7 +38,7 @@ namespace boost { namespace fusion { namespace detail
typedef cons<range_type, Context> type;
typedef mpl::false_ continue_type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, State const&, Context const& context, segmented_begin_fun)
{
return type(range_type(fusion::begin(seq), fusion::end(seq)), context);
@ -64,7 +64,7 @@ namespace boost { namespace fusion { namespace detail
typedef typename fold_impl::type type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, Stack const& stack)
{
return fold_impl::call(seq, end_impl::call(seq, stack), stack, segmented_begin_fun());
@ -79,7 +79,7 @@ namespace boost { namespace fusion { namespace detail
typedef iterator_range<begin_type, end_type> pair_type;
typedef cons<pair_type, Stack> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& seq, Stack stack)
{
return type(pair_type(fusion::begin(seq), fusion::end(seq)), stack);

View File

@ -28,7 +28,7 @@ namespace boost { namespace fusion { namespace detail
>
type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence & seq)
{
return type(

View File

@ -48,7 +48,7 @@ namespace boost { namespace fusion { namespace detail
typedef iterator_range<end_type, end_type> pair_type;
typedef cons<pair_type, Stack> type;
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence & seq, Stack stack)
{
end_type end = fusion::end(fusion::segments(seq));

View File

@ -51,7 +51,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::empty<Sequence>::type
empty(Sequence const&)
{

View File

@ -71,7 +71,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -83,7 +83,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_enable_if<
traits::is_sequence<Sequence>

View File

@ -26,7 +26,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::front<Sequence>::type
front(Sequence& seq)
{
@ -34,7 +34,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::front<Sequence const>::type
front(Sequence const& seq)
{

View File

@ -68,7 +68,7 @@ namespace boost { namespace fusion
}
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::has_key<Sequence, Key>::type
has_key(Sequence const&)
{

View File

@ -54,7 +54,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@ -67,7 +67,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::segments<Sequence const>::type
segments(Sequence const& seq)
{

View File

@ -78,7 +78,7 @@ namespace boost { namespace fusion
}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::size<Sequence>::type
size(Sequence const&)
{

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion {
};
template<typename Elem>
BOOST_FUSION_GPU_ENABLED
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void operator()(Elem const& e) const
{
using std::swap;
@ -50,8 +50,8 @@ namespace boost { namespace fusion {
}
template<typename Seq1, typename Seq2>
BOOST_FUSION_GPU_ENABLED
typename enable_if<mpl::and_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >, void>::type
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename enable_if<mpl::and_<traits::is_sequence<Seq1>, traits::is_sequence<Seq2> >, void>::type
swap(Seq1& lhs, Seq2& rhs)
{
typedef vector<Seq1&, Seq2&> references;

View File

@ -93,7 +93,7 @@ namespace boost { namespace fusion
}
template <typename N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_disable_if<
is_const<Sequence>
@ -102,12 +102,12 @@ namespace boost { namespace fusion
at(Sequence& seq);
template <typename N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::at<Sequence const, N>::type
at(Sequence const& seq);
template <int N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_disable_if<
is_const<Sequence>
@ -116,22 +116,22 @@ namespace boost { namespace fusion
at_c(Sequence& seq);
template <int N, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::at_c<Sequence const, N>::type
at_c(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::back<Sequence>::type
back(Sequence& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::back<Sequence const>::type
back(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -140,7 +140,7 @@ namespace boost { namespace fusion
begin(Sequence& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -149,12 +149,12 @@ namespace boost { namespace fusion
begin(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::empty<Sequence>::type
empty(Sequence const&);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -163,7 +163,7 @@ namespace boost { namespace fusion
end(Sequence& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_enable_if<
traits::is_sequence<Sequence>
@ -172,22 +172,22 @@ namespace boost { namespace fusion
end(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::front<Sequence>::type
front(Sequence& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::front<Sequence const>::type
front(Sequence const& seq);
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::has_key<Sequence, Key>::type
has_key(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_disable_if<
is_const<Sequence>
@ -196,17 +196,17 @@ namespace boost { namespace fusion
segments(Sequence& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::segments<Sequence const>::type
segments(Sequence const& seq);
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::size<Sequence>::type
size(Sequence const&);
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename
lazy_disable_if<
is_const<Sequence>
@ -215,7 +215,7 @@ namespace boost { namespace fusion
at_key(Sequence& seq);
template <typename Key, typename Sequence>
BOOST_FUSION_GPU_ENABLED
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename result_of::at_key<Sequence const, Key>::type
at_key(Sequence const& seq);
}}

View File

@ -0,0 +1,42 @@
/*=============================================================================
Copyright (c) 2001-2014 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_RESULT_OF_10272014_0654)
#define FUSION_RESULT_OF_10272014_0654
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion { namespace detail
{
// This is a temporary workaround for result_of before we make fusion fully
// sfinae result_of friendy, which will require some heavy lifting for some
// low level code. So far this is used only in the fold algorithm. This will
// be removed once we overhaul fold.
#if defined(BOOST_NO_CXX11_DECLTYPE)
template <typename Sig>
struct result_of_with_decltype : boost::tr1_result_of<Sig> {};
#else
BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
template <typename Sig>
struct result_of_with_decltype;
template <typename F, typename... Args>
struct result_of_with_decltype<F(Args...)>
: mpl::if_<mpl::or_<has_result_type<F>, detail::has_result<F>>,
boost::tr1_result_of<F(Args...)>,
boost::detail::cpp0x_result_of<F(Args...)>>::type {};
#endif
}}}
#endif

View File

@ -5,7 +5,7 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_REPETITIVE_REPETITIVE_VIEW_VIEW_HPP_INCLUDED)
#ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
#define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>

20
meta/libraries.json Normal file
View File

@ -0,0 +1,20 @@
{
"key": "fusion",
"name": "Fusion",
"authors": [
"Joel de Guzman",
"Dan Marsden",
"Tobias Schwinger"
],
"description": "Library for working with tuples, including various containers, algorithms, etc.",
"documentation": "doc/html/",
"category": [
"Data",
"Metaprogramming"
],
"maintainers": [
"Joel de Guzman <joel -at- boost-consulting.com>",
"Dan Marsden <danmarsden -at- yahoo.co.uk>",
"Tobias Schwinger <tschwinger -at- isonews2.com>"
]
}

View File

@ -10,6 +10,8 @@
-D_M_IX86
-NBOOST_STATIC_ASSERT
-NBOOST_FORCEINLINE
-NBOOST_CONSTEXPR
-NBOOST_CXX14_CONSTEXPR
-NBOOST_MPL_ASSERT
-NBOOST_MPL_ASSERT_MSG
-NBOOST_MPL_ASSERT_RELATION

View File

@ -63,6 +63,7 @@ project
[ run sequence/boost_tuple.cpp : : : : ]
[ run sequence/cons.cpp : : : : ]
[ run sequence/filter_view.cpp : : : : ]
[ run sequence/hash.cpp : : : : ]
[ run sequence/io.cpp : : : : ]
[ run sequence/iterator_range.cpp : : : : ]
[ run sequence/joint_view.cpp : : : : ]
@ -70,6 +71,7 @@ project
[ run sequence/list_construction.cpp : : : : ]
[ run sequence/list_copy.cpp : : : : ]
[ run sequence/list_iterator.cpp : : : : ]
[ run sequence/list_hash.cpp : : : : ]
[ run sequence/list_make.cpp : : : : ]
[ run sequence/list_misc.cpp : : : : ]
[ run sequence/list_mutate.cpp : : : : ]
@ -79,6 +81,7 @@ project
[ run sequence/deque_construction.cpp : : : : ]
[ run sequence/deque_copy.cpp : : : : ]
[ run sequence/deque_iterator.cpp : : : : ]
[ run sequence/deque_hash.cpp : : : : ]
[ run sequence/deque_make.cpp : : : : ]
[ run sequence/deque_misc.cpp : : : : ]
[ run sequence/deque_move.cpp : : : : ]
@ -112,8 +115,8 @@ project
[ run sequence/tuple_make.cpp : : : : ]
[ run sequence/tuple_misc.cpp : : : : ]
[ run sequence/tuple_mutate.cpp : : : : ]
[ run sequence/tuple_hash.cpp : : : : ]
[ run sequence/tuple_tie.cpp : : : : ]
[ run sequence/tr1_tuple_auto_conv.cpp : : : : ]
[ run sequence/transform_view.cpp : : : : ]
[ run sequence/vector_comparison.cpp : : : : ]
[ run sequence/vector_construction.cpp : : : : ]
@ -124,6 +127,7 @@ project
[ run sequence/vector_move.cpp : : : : ]
[ run sequence/vector_mutate.cpp : : : : ]
[ run sequence/vector_n.cpp : : : : ]
[ run sequence/vector_hash.cpp : : : : ]
[ run sequence/vector_tie.cpp : : : : ]
[ run sequence/vector_value_at.cpp : : : : ]
[ run sequence/zip_view.cpp : : : : ]
@ -150,6 +154,8 @@ project
[ run sequence/define_tpl_struct.cpp : : : : ]
[ run sequence/define_tpl_struct_inline.cpp : : : : ]
[ run sequence/define_assoc_tpl_struct.cpp : : : : ]
[ run sequence/std_tuple.cpp : : : : ]
[ run sequence/std_tuple_auto_conv.cpp : : : : ]
[ run sequence/std_tuple_iterator.cpp : : : : ]
[ run sequence/ref_vector.cpp : : : : ]
[ run sequence/flatten_view.cpp : : : : ]

View File

@ -23,6 +23,7 @@
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/sequence/convert.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/tuple/tuple.hpp>
@ -87,7 +88,14 @@ main()
fusion::list<int, std::string> l(tuples::make_tuple(123, "Hola!!!"));
l = tuples::make_tuple(123, "Hola!!!");
}
{
// conversion vector to boost tuple
boost::tuple<int, std::string> t = convert<boost_tuple_tag>(make_vector(123, "Hola!!!"));
BOOST_TEST(get<0>(t) == 123);
BOOST_TEST(get<1>(t) == "Hola!!!");
}
{
// test from Ticket #1601, submitted by Shunsuke Sogame
// expanded by Stjepan Rajko

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/fusion/container/deque/deque.hpp>
#define FUSION_SEQUENCE deque
#include "hash.hpp"
int main()
{
hash_test();
return boost::report_errors();
}

58
test/sequence/hash.cpp Normal file
View File

@ -0,0 +1,58 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <string>
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/fusion/sequence/hash.hpp>
struct test_struct
{
test_struct(bool bb, int ii, char cc, std::string const& ss) :
b(bb),
i(ii),
c(cc),
s(ss) {}
bool b;
int i;
char c;
std::string s;
};
BOOST_FUSION_ADAPT_STRUCT(
test_struct,
(bool, b)
(int, i)
(char, c)
(std::string, s)
)
int main()
{
using boost::fusion::hash_value;
const test_struct a0(false, 1, 'c', "Hello Nurse"),
a1(false, 1, 'c', "Hello Nurse"),
b(true, 1, 'c', "Hello Nurse"),
c(false, 0, 'c', "Hello Nurse"),
d(false, 1, 'd', "Hello Nurse"),
e(false, 1, 'c', "Hello World");
BOOST_TEST(hash_value(a0) == hash_value(a1));
BOOST_TEST(hash_value(a0) != hash_value(b));
BOOST_TEST(hash_value(a0) != hash_value(c));
BOOST_TEST(hash_value(a0) != hash_value(d));
BOOST_TEST(hash_value(a0) != hash_value(e));
BOOST_TEST(hash_value(b) != hash_value(c));
BOOST_TEST(hash_value(b) != hash_value(d));
BOOST_TEST(hash_value(b) != hash_value(d));
BOOST_TEST(hash_value(c) != hash_value(d));
BOOST_TEST(hash_value(c) != hash_value(e));
BOOST_TEST(hash_value(d) != hash_value(e));
}

34
test/sequence/hash.hpp Normal file
View File

@ -0,0 +1,34 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <string>
#include <utility>
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/sequence/hash.hpp>
#include <boost/functional/hash.hpp>
void
hash_test()
{
using namespace boost::fusion;
const FUSION_SEQUENCE<int, char, bool, std::string> v0(42, 'x', false, "Aurea prima");
const FUSION_SEQUENCE<int, char, bool, std::string> v1(42, 'x', false, "Aurea prima");
BOOST_TEST(hash_value(v0) == hash_value(v1));
const FUSION_SEQUENCE<int, char, bool, std::string> w(41, 'x', false, "Aurea prima");
BOOST_TEST(hash_value(w) != hash_value(v0));
const FUSION_SEQUENCE<int, char, bool, std::string> x(42, 'y', false, "Aurea prima");
BOOST_TEST(hash_value(x) != hash_value(v0));
const FUSION_SEQUENCE<int, char, bool, std::string> y(42, 'x', true, "Aurea prima");
BOOST_TEST(hash_value(y) != hash_value(v0));
const FUSION_SEQUENCE<int, char, bool, std::string> z(42, 'x', false, "quae vindice nullo");
BOOST_TEST(hash_value(z) != hash_value(v0));
}

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/fusion/container/list/list.hpp>
#define FUSION_SEQUENCE list
#include "hash.hpp"
int main()
{
hash_test();
return boost::report_errors();
}

View File

@ -0,0 +1,46 @@
/*=============================================================================
Copyright (c) 2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/config.hpp>
// adapted/std_tuple.hpp only supports implementations using variadic templates
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/fusion/sequence/convert.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <tuple>
#include <string>
int
main()
{
using namespace boost::fusion;
using namespace boost;
{
// conversion vector to std tuple
std::tuple<int, std::string> t = convert<std_tuple_tag>(make_vector(123, "Hola!!!"));
BOOST_TEST(std::get<0>(t) == 123);
BOOST_TEST(std::get<1>(t) == "Hola!!!");
}
return boost::report_errors();
}
#else
int
main()
{
return 0;
}
#endif

View File

@ -1,5 +1,10 @@
#include <boost/tr1/memory.hpp>
#include <boost/tr1/tuple.hpp>
#include <boost/config.hpp>
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \
!defined(BOOST_NO_CXX11_SMART_PTR)
#include <memory>
#include <tuple>
#include <boost/any.hpp>
#include <iostream>
@ -7,10 +12,10 @@ namespace Core
{
class AutoConverter
{
std::tr1::shared_ptr<boost::any> t_;
std::shared_ptr<boost::any> t_;
public:
AutoConverter(std::tr1::shared_ptr<boost::any> const & t)
AutoConverter(std::shared_ptr<boost::any> const & t)
: t_(t)
{}
@ -40,8 +45,8 @@ namespace Core
inline AutoConverter Demo()
{
std::tr1::shared_ptr<boost::any> p_result
(new boost::any(std::tr1::make_tuple(1, 2, 3, 4)));
std::shared_ptr<boost::any> p_result
(new boost::any(std::make_tuple(1, 2, 3, 4)));
return p_result;
}
@ -50,7 +55,16 @@ namespace Core
int main()
{
std::tr1::tuple<int, int, int, int> test = Core::Demo();
std::tuple<int, int, int, int> test = Core::Demo();
return 0;
}
#else
int main()
{
return 0;
}
#endif

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/fusion/tuple/tuple.hpp>
#define FUSION_SEQUENCE tuple
#include "hash.hpp"
int main()
{
hash_test();
return boost::report_errors();
}

View File

@ -0,0 +1,16 @@
/*=============================================================================
Copyright (c) 2014 Christoph Weiss
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/fusion/container/vector/vector.hpp>
#define FUSION_SEQUENCE vector
#include "hash.hpp"
int main()
{
hash_test();
return boost::report_errors();
}