summaryrefslogtreecommitdiff
path: root/boost/fusion/container/list/cons.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:45:20 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 15:46:37 +0900
commit733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /boost/fusion/container/list/cons.hpp
parent08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff)
downloadboost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/fusion/container/list/cons.hpp')
-rw-r--r--boost/fusion/container/list/cons.hpp41
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;