diff options
Diffstat (limited to 'boost/fusion/sequence')
32 files changed, 175 insertions, 109 deletions
diff --git a/boost/fusion/sequence/comparison/detail/equal_to.hpp b/boost/fusion/sequence/comparison/detail/equal_to.hpp index 577023db6a..cffed6c399 100644 --- a/boost/fusion/sequence/comparison/detail/equal_to.hpp +++ b/boost/fusion/sequence/comparison/detail/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_equal_to<Seq1, Seq2, false> { template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& /*a*/, I2 const& /*b*/) { diff --git a/boost/fusion/sequence/comparison/detail/greater.hpp b/boost/fusion/sequence/comparison/detail/greater.hpp index d875f16b2b..d762652935 100644 --- a/boost/fusion/sequence/comparison/detail/greater.hpp +++ b/boost/fusion/sequence/comparison/detail/greater.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/boost/fusion/sequence/comparison/detail/greater_equal.hpp b/boost/fusion/sequence/comparison/detail/greater_equal.hpp index e0aa530e18..d15d88c404 100644 --- a/boost/fusion/sequence/comparison/detail/greater_equal.hpp +++ b/boost/fusion/sequence/comparison/detail/greater_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/boost/fusion/sequence/comparison/detail/less.hpp b/boost/fusion/sequence/comparison/detail/less.hpp index 8964ca7d13..04377d6960 100644 --- a/boost/fusion/sequence/comparison/detail/less.hpp +++ b/boost/fusion/sequence/comparison/detail/less.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/boost/fusion/sequence/comparison/detail/less_equal.hpp b/boost/fusion/sequence/comparison/detail/less_equal.hpp index 10bcb76791..e61d33c4fa 100644 --- a/boost/fusion/sequence/comparison/detail/less_equal.hpp +++ b/boost/fusion/sequence/comparison/detail/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/boost/fusion/sequence/comparison/detail/not_equal_to.hpp b/boost/fusion/sequence/comparison/detail/not_equal_to.hpp index b230ac1fba..323b2ac9d0 100644 --- a/boost/fusion/sequence/comparison/detail/not_equal_to.hpp +++ b/boost/fusion/sequence/comparison/detail/not_equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end<Seq2>::type end2_type; template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_not_equal_to<Seq1, Seq2, false> { template <typename I1, typename I2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/boost/fusion/sequence/comparison/equal_to.hpp b/boost/fusion/sequence/comparison/equal_to.hpp index 485df0bac2..283ffefc8b 100644 --- a/boost/fusion/sequence/comparison/equal_to.hpp +++ b/boost/fusion/sequence/comparison/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool equal_to(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality<Seq1, Seq2> diff --git a/boost/fusion/sequence/comparison/greater.hpp b/boost/fusion/sequence/comparison/greater.hpp index 5ad7ef74b9..fbbb7bfae2 100644 --- a/boost/fusion/sequence/comparison/greater.hpp +++ b/boost/fusion/sequence/comparison/greater.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison<Seq1, Seq2> diff --git a/boost/fusion/sequence/comparison/greater_equal.hpp b/boost/fusion/sequence/comparison/greater_equal.hpp index 65904f8339..7b91a8886b 100644 --- a/boost/fusion/sequence/comparison/greater_equal.hpp +++ b/boost/fusion/sequence/comparison/greater_equal.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater_equal(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison<Seq1, Seq2> diff --git a/boost/fusion/sequence/comparison/less.hpp b/boost/fusion/sequence/comparison/less.hpp index 28762b7394..b056552a9e 100644 --- a/boost/fusion/sequence/comparison/less.hpp +++ b/boost/fusion/sequence/comparison/less.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less(Seq1 const& a, Seq2 const& b) { @@ -29,7 +29,7 @@ namespace boost { namespace fusion namespace operators { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison<Seq1, Seq2> diff --git a/boost/fusion/sequence/comparison/less_equal.hpp b/boost/fusion/sequence/comparison/less_equal.hpp index d0668208f0..53159926c8 100644 --- a/boost/fusion/sequence/comparison/less_equal.hpp +++ b/boost/fusion/sequence/comparison/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less_equal(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion #if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400) // Workaround for VC8.0 and VC7.1 template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator<=(sequence_base<Seq1> const& a, sequence_base<Seq2> const& b) { @@ -49,7 +49,7 @@ namespace boost { namespace fusion } template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if<traits::is_native_fusion_sequence<Seq2>, bool>::type operator<=(sequence_base<Seq1> const& a, Seq2 const& b) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion } template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if<traits::is_native_fusion_sequence<Seq1>, bool>::type operator<=(Seq1 const& a, sequence_base<Seq2> const& b) { @@ -69,7 +69,7 @@ namespace boost { namespace fusion // but barfs somewhere else. template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison<Seq1, Seq2> diff --git a/boost/fusion/sequence/comparison/not_equal_to.hpp b/boost/fusion/sequence/comparison/not_equal_to.hpp index 4cd94f9e53..fc2fef3343 100644 --- a/boost/fusion/sequence/comparison/not_equal_to.hpp +++ b/boost/fusion/sequence/comparison/not_equal_to.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool not_equal_to(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion namespace operators { template <typename Seq1, typename Seq2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality<Seq1, Seq2> diff --git a/boost/fusion/sequence/convert.hpp b/boost/fusion/sequence/convert.hpp index 461b92120d..b367714ca2 100644 --- a/boost/fusion/sequence/convert.hpp +++ b/boost/fusion/sequence/convert.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_CONVERT_10022005_1442) #define FUSION_CONVERT_10022005_1442 +#include <boost/fusion/support/config.hpp> + namespace boost { namespace fusion { namespace extension @@ -29,7 +31,7 @@ namespace boost { namespace fusion } template <typename Tag, typename Sequence> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert<Tag, Sequence>::type convert(Sequence& seq) { @@ -38,7 +40,7 @@ namespace boost { namespace fusion } template <typename Tag, typename Sequence> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert<Tag, Sequence const>::type convert(Sequence const& seq) { diff --git a/boost/fusion/sequence/hash.hpp b/boost/fusion/sequence/hash.hpp new file mode 100644 index 0000000000..bc5b1499dc --- /dev/null +++ b/boost/fusion/sequence/hash.hpp @@ -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 diff --git a/boost/fusion/sequence/intrinsic.hpp b/boost/fusion/sequence/intrinsic.hpp index 4583807406..d3e5af0b03 100644 --- a/boost/fusion/sequence/intrinsic.hpp +++ b/boost/fusion/sequence/intrinsic.hpp @@ -20,5 +20,6 @@ #include <boost/fusion/sequence/intrinsic/value_at.hpp> #include <boost/fusion/sequence/intrinsic/at_key.hpp> #include <boost/fusion/sequence/intrinsic/value_at_key.hpp> +#include <boost/fusion/sequence/intrinsic/swap.hpp> #endif diff --git a/boost/fusion/sequence/intrinsic/at.hpp b/boost/fusion/sequence/intrinsic/at.hpp index aa0d97445d..fdfa72a60a 100644 --- a/boost/fusion/sequence/intrinsic/at.hpp +++ b/boost/fusion/sequence/intrinsic/at.hpp @@ -9,6 +9,9 @@ #include <boost/fusion/support/config.hpp> #include <boost/mpl/int.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/less.hpp> +#include <boost/mpl/empty_base.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/fusion/sequence/intrinsic_fwd.hpp> #include <boost/fusion/support/tag_of.hpp> @@ -56,12 +59,23 @@ namespace boost { namespace fusion struct at_impl<std_tuple_tag>; } + namespace detail + { + template <typename Sequence, typename N, typename Tag> + struct at_impl + : mpl::if_< + mpl::less<N, typename extension::size_impl<Tag>::template apply<Sequence>::type> + , typename extension::at_impl<Tag>::template apply<Sequence, N> + , mpl::empty_base + >::type + {}; + } + namespace result_of { template <typename Sequence, typename N> struct at - : extension::at_impl<typename detail::tag_of<Sequence>::type>:: - template apply<Sequence, N> + : detail::at_impl<Sequence, N, typename detail::tag_of<Sequence>::type> {}; template <typename Sequence, int N> @@ -72,7 +86,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 +98,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 +106,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 +118,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) { diff --git a/boost/fusion/sequence/intrinsic/at_key.hpp b/boost/fusion/sequence/intrinsic/at_key.hpp index 844de840e4..4693a90553 100644 --- a/boost/fusion/sequence/intrinsic/at_key.hpp +++ b/boost/fusion/sequence/intrinsic/at_key.hpp @@ -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) { diff --git a/boost/fusion/sequence/intrinsic/back.hpp b/boost/fusion/sequence/intrinsic/back.hpp index f934355381..3f998a7d9a 100644 --- a/boost/fusion/sequence/intrinsic/back.hpp +++ b/boost/fusion/sequence/intrinsic/back.hpp @@ -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) { diff --git a/boost/fusion/sequence/intrinsic/begin.hpp b/boost/fusion/sequence/intrinsic/begin.hpp index af4e31225d..79c14d74ab 100644 --- a/boost/fusion/sequence/intrinsic/begin.hpp +++ b/boost/fusion/sequence/intrinsic/begin.hpp @@ -8,8 +8,8 @@ #define FUSION_BEGIN_04052005_1132 #include <boost/fusion/support/config.hpp> -#include <boost/blank.hpp> #include <boost/utility/enable_if.hpp> +#include <boost/mpl/empty_base.hpp> #include <boost/mpl/if.hpp> #include <boost/fusion/sequence/intrinsic_fwd.hpp> #include <boost/fusion/support/tag_of.hpp> @@ -36,7 +36,7 @@ namespace boost { namespace fusion : mpl::if_< traits::is_segmented<Sequence> , detail::segmented_begin<Sequence> - , blank + , mpl::empty_base >::type {}; }; @@ -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> diff --git a/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp b/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp index 81d09660b1..ec20ac414d 100644 --- a/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp +++ b/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp @@ -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( diff --git a/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp b/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp index 2ab462702d..12d9e24c47 100644 --- a/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp +++ b/boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp @@ -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); diff --git a/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp b/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp index c26865a671..55419ed80d 100644 --- a/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp +++ b/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp @@ -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( diff --git a/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp b/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp index 9be150433a..da48649a24 100644 --- a/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp +++ b/boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp @@ -48,11 +48,18 @@ 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 pair_type make_pair(end_type end) + { + return pair_type(end, end); + } + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence & seq, Stack stack) { - end_type end = fusion::end(fusion::segments(seq)); - return type(pair_type(end, end), stack); + return type( + make_pair(fusion::end(fusion::segments(seq))), + stack); } }; diff --git a/boost/fusion/sequence/intrinsic/empty.hpp b/boost/fusion/sequence/intrinsic/empty.hpp index 3c8666abd4..6a0dbe74a5 100644 --- a/boost/fusion/sequence/intrinsic/empty.hpp +++ b/boost/fusion/sequence/intrinsic/empty.hpp @@ -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&) { diff --git a/boost/fusion/sequence/intrinsic/end.hpp b/boost/fusion/sequence/intrinsic/end.hpp index 3e69518efa..b342468f0e 100644 --- a/boost/fusion/sequence/intrinsic/end.hpp +++ b/boost/fusion/sequence/intrinsic/end.hpp @@ -8,8 +8,8 @@ #define FUSION_END_04052005_1141 #include <boost/fusion/support/config.hpp> -#include <boost/blank.hpp> #include <boost/utility/enable_if.hpp> +#include <boost/mpl/empty_base.hpp> #include <boost/mpl/if.hpp> #include <boost/fusion/sequence/intrinsic_fwd.hpp> #include <boost/fusion/support/tag_of.hpp> @@ -36,7 +36,7 @@ namespace boost { namespace fusion : mpl::if_< traits::is_segmented<Sequence> , detail::segmented_end<Sequence> - , blank + , mpl::empty_base >::type {}; }; @@ -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> diff --git a/boost/fusion/sequence/intrinsic/front.hpp b/boost/fusion/sequence/intrinsic/front.hpp index 6d939da3d3..8971298ac8 100644 --- a/boost/fusion/sequence/intrinsic/front.hpp +++ b/boost/fusion/sequence/intrinsic/front.hpp @@ -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) { diff --git a/boost/fusion/sequence/intrinsic/has_key.hpp b/boost/fusion/sequence/intrinsic/has_key.hpp index bba2c695b3..d69a82fbff 100644 --- a/boost/fusion/sequence/intrinsic/has_key.hpp +++ b/boost/fusion/sequence/intrinsic/has_key.hpp @@ -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&) { diff --git a/boost/fusion/sequence/intrinsic/segments.hpp b/boost/fusion/sequence/intrinsic/segments.hpp index a1bbacaf06..41501a9643 100644 --- a/boost/fusion/sequence/intrinsic/segments.hpp +++ b/boost/fusion/sequence/intrinsic/segments.hpp @@ -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) { diff --git a/boost/fusion/sequence/intrinsic/size.hpp b/boost/fusion/sequence/intrinsic/size.hpp index 51e613f693..97aa3ef9ec 100644 --- a/boost/fusion/sequence/intrinsic/size.hpp +++ b/boost/fusion/sequence/intrinsic/size.hpp @@ -49,10 +49,10 @@ namespace boost { namespace fusion template <typename Sequence> struct apply : Sequence::template size<Sequence> {}; }; - + template <> struct size_impl<boost_tuple_tag>; - + template <> struct size_impl<boost_array_tag>; @@ -67,18 +67,14 @@ namespace boost { namespace fusion { template <typename Sequence> struct size - : extension::size_impl<typename detail::tag_of<Sequence>::type>:: - template apply<Sequence> - - { - typedef typename extension::size_impl<typename detail::tag_of<Sequence>::type>:: - template apply<Sequence>::type size_application; - BOOST_STATIC_CONSTANT(int, value = size_application::value); - }; + : mpl::int_< + extension::size_impl<typename detail::tag_of<Sequence>::type> + ::template apply<Sequence>::type::value + > {}; } template <typename Sequence> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::size<Sequence>::type size(Sequence const&) { diff --git a/boost/fusion/sequence/intrinsic/swap.hpp b/boost/fusion/sequence/intrinsic/swap.hpp index 05ce9b44b1..8c49dc4896 100644 --- a/boost/fusion/sequence/intrinsic/swap.hpp +++ b/boost/fusion/sequence/intrinsic/swap.hpp @@ -14,19 +14,21 @@ #include <boost/fusion/support/is_sequence.hpp> #include <boost/fusion/view/zip_view.hpp> #include <boost/fusion/algorithm/iteration/for_each.hpp> -#include <boost/utility/enable_if.hpp> #include <boost/fusion/sequence/intrinsic/front.hpp> #include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/core/enable_if.hpp> #include <boost/mpl/and.hpp> namespace boost { namespace fusion { + namespace result_of { template<typename Seq1, typename Seq2> struct swap - { - typedef void type; - }; + : enable_if<mpl::and_< + traits::is_sequence<Seq1>, + traits::is_sequence<Seq2> + > > {}; } namespace detail @@ -40,7 +42,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 +52,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 + inline typename result_of::swap<Seq1, Seq2>::type swap(Seq1& lhs, Seq2& rhs) { typedef vector<Seq1&, Seq2&> references; diff --git a/boost/fusion/sequence/intrinsic_fwd.hpp b/boost/fusion/sequence/intrinsic_fwd.hpp index 3b248a04bb..a6354ea3bb 100644 --- a/boost/fusion/sequence/intrinsic_fwd.hpp +++ b/boost/fusion/sequence/intrinsic_fwd.hpp @@ -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); }} diff --git a/boost/fusion/sequence/io/detail/manip.hpp b/boost/fusion/sequence/io/detail/manip.hpp index 8d8c296d3b..ec8ce304f6 100644 --- a/boost/fusion/sequence/io/detail/manip.hpp +++ b/boost/fusion/sequence/io/detail/manip.hpp @@ -235,14 +235,16 @@ namespace boost { namespace fusion template <typename Stream, typename Char, typename Traits> \ Stream& operator>>(Stream& s, const name##_type<Char,Traits>& m) \ { \ - string_ios_manip<name##_tag, Stream>(s).set(m.data); \ + string_ios_manip<name##_tag, Stream> manip(s); \ + manip.set(m.data); \ return s; \ } \ \ template <typename Stream, typename Char, typename Traits> \ Stream& operator<<(Stream& s, const name##_type<Char,Traits>& m) \ { \ - string_ios_manip<name##_tag, Stream>(s).set(m.data); \ + string_ios_manip<name##_tag, Stream> manip(s); \ + manip.set(m.data); \ return s; \ } \ } \ |