forked from boostorg/fusion
More constexpr and noexcept support.
Note 1: Forwarding functions are specified as a C++14 constexpr since std::forward is not a constexpr within C++11. Note 2: Though I'm not sure why it doesn't compile, some declarations are specified as a C++14 constexpr or non-constexpr. Note 3: Boost.Tuple adaptation and TR1-based tuple implementations are not constexpr.
This commit is contained in:
@ -39,7 +39,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator<advanced_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator2<advanced1_type, advanced2_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace boost { namespace fusion {
|
||||
typedef typename boost::fusion::result_of::at<typename Seq::sequence_type, N>::type value_type;
|
||||
typedef typename mpl::apply<transform_type, value_type>::type type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Seq& seq)
|
||||
{
|
||||
return seq.f(boost::fusion::at<N>(seq.seq));
|
||||
@ -53,7 +53,7 @@ namespace boost { namespace fusion {
|
||||
typedef typename boost::fusion::result_of::at<typename Seq::sequence2_type, N>::type value2_type;
|
||||
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Seq& seq)
|
||||
{
|
||||
return seq.f(boost::fusion::at<N>(seq.seq1), boost::fusion::at<N>(seq.seq2));
|
||||
|
@ -34,7 +34,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::transform_type transform_type;
|
||||
typedef transform_view_iterator<first_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
@ -55,7 +55,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::transform_type transform_type;
|
||||
typedef transform_view_iterator2<first1_type, first2_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ namespace boost { namespace fusion
|
||||
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
|
||||
typedef typename mpl::apply<transform_type, value_type>::type type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
@ -63,7 +63,7 @@ namespace boost { namespace fusion
|
||||
typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
|
||||
typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ namespace boost { namespace fusion {
|
||||
struct apply
|
||||
: result_of::distance<typename First::first_type, typename Last::first_type>
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static
|
||||
typename result_of::distance<typename First::first_type, typename Last::first_type>::type
|
||||
call(First const& first, Last const& last)
|
||||
@ -47,7 +47,7 @@ namespace boost { namespace fusion {
|
||||
struct apply
|
||||
: result_of::distance<typename First::first1_type, typename Last::first1_type>
|
||||
{
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static
|
||||
typename result_of::distance<typename First::first1_type, typename Last::first1_type>::type
|
||||
call(First const& first, Last const& last)
|
||||
|
@ -34,7 +34,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::transform_type transform_type;
|
||||
typedef transform_view_iterator<last_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
@ -55,7 +55,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Sequence::transform_type transform_type;
|
||||
typedef transform_view_iterator2<last1_type, last2_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Sequence& s)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator<next_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
@ -61,7 +61,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator2<next1_type, next2_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator<prior_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace boost { namespace fusion
|
||||
typedef typename Iterator::transform_type transform_type;
|
||||
typedef transform_view_iterator2<prior1_type, prior2_type, transform_type> type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
|
@ -56,20 +56,20 @@ namespace boost { namespace fusion
|
||||
typedef Sequence2 sequence2_type;
|
||||
typedef F transform_type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
transform_view(Sequence1& in_seq1, Sequence2& in_seq2, F const& binop)
|
||||
: f(binop)
|
||||
, seq1(in_seq1)
|
||||
, seq2(in_seq2)
|
||||
{}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first1_type first1() const { return fusion::begin(seq1); }
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first2_type first2() const { return fusion::begin(seq2); }
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last1_type last1() const { return fusion::end(seq1); }
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last2_type last2() const { return fusion::end(seq2); }
|
||||
|
||||
transform_type f;
|
||||
@ -100,15 +100,15 @@ namespace boost { namespace fusion
|
||||
typedef Sequence sequence_type;
|
||||
typedef F transform_type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
transform_view(Sequence& in_seq, F const& in_f)
|
||||
: seq(in_seq)
|
||||
, f(in_f)
|
||||
{}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq); }
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last_type last() const { return fusion::end(seq); }
|
||||
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
|
||||
transform_type f;
|
||||
|
@ -35,7 +35,7 @@ namespace boost { namespace fusion
|
||||
typedef typename traits::category_of<first_type>::type category;
|
||||
typedef F transform_type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
transform_view_iterator(First const& in_first, F const& in_f)
|
||||
: first(converter::call(in_first)), f(in_f) {}
|
||||
|
||||
@ -62,7 +62,7 @@ namespace boost { namespace fusion
|
||||
typedef typename traits::category_of<first1_type>::type category;
|
||||
typedef F transform_type;
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f)
|
||||
: first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {}
|
||||
|
||||
|
Reference in New Issue
Block a user