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:
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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&)
|
||||
{
|
||||
|
@@ -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;
|
||||
|
@@ -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));
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user