diff options
Diffstat (limited to 'boost/fusion/container/list/cons.hpp')
-rw-r--r-- | boost/fusion/container/list/cons.hpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/boost/fusion/container/list/cons.hpp b/boost/fusion/container/list/cons.hpp index 1de7048b63..61d8dbcfe1 100644 --- a/boost/fusion/container/list/cons.hpp +++ b/boost/fusion/container/list/cons.hpp @@ -25,9 +25,11 @@ #include <boost/type_traits/is_convertible.hpp> #include <boost/utility/enable_if.hpp> #include <boost/fusion/support/sequence_base.hpp> +#include <boost/fusion/support/is_sequence.hpp> #include <boost/mpl/int.hpp> #include <boost/mpl/bool.hpp> -#include <boost/mpl/or.hpp> +#include <boost/mpl/and.hpp> +#include <boost/mpl/not.hpp> namespace boost { namespace fusion { @@ -47,51 +49,50 @@ namespace boost { namespace fusion typedef Car car_type; typedef Cdr cdr_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons() : car(), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit cons(typename detail::call_param<Car>::type in_car) : car(in_car), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( typename detail::call_param<Car>::type in_car , typename detail::call_param<Cdr>::type in_cdr) : car(in_car), cdr(in_cdr) {} template <typename Car2, typename Cdr2> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons<Car2, Cdr2> const& rhs) : car(rhs.car), cdr(rhs.cdr) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons const& rhs) : car(rhs.car), cdr(rhs.cdr) {} template <typename Sequence> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( Sequence const& seq - , typename boost::disable_if< - mpl::or_< - is_convertible<Sequence, cons> // use copy ctor instead - , is_convertible<Sequence, Car> // use copy to car instead - > + , typename boost::enable_if< + mpl::and_< + traits::is_sequence<Sequence> + , mpl::not_<is_convertible<Sequence, Car> > > // use copy to car instead >::type* /*dummy*/ = 0 ) : car(*fusion::begin(seq)) , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} template <typename Iterator> - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) : car(*iter) , cdr(fusion::next(iter), mpl::true_()) {} template <typename Car2, typename Cdr2> - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons<Car2, Cdr2> const& rhs) { car = rhs.car; @@ -99,7 +100,7 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons const& rhs) { car = rhs.car; @@ -108,8 +109,12 @@ namespace boost { namespace fusion } template <typename Sequence> - BOOST_FUSION_GPU_ENABLED - typename boost::disable_if<is_convertible<Sequence, Car>, cons&>::type + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + typename boost::enable_if< + mpl::and_< + traits::is_sequence<Sequence> + , mpl::not_<is_convertible<Sequence, Car> > > + , cons&>::type operator=(Sequence const& seq) { typedef typename result_of::begin<Sequence const>::type Iterator; @@ -119,7 +124,7 @@ namespace boost { namespace fusion } template <typename Iterator> - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void assign_from_iter(Iterator const& iter) { car = *iter; |