forked from boostorg/fusion
+ Fixes ticket #7914
+ C++11 implementations for make_deque, deque_tie and as_deque [SVN r82630]
This commit is contained in:
@ -38,10 +38,11 @@
|
||||
: vec(BOOST_PP_ENUM_PARAMS(N, _)) {}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
|
||||
#if N == 1
|
||||
explicit
|
||||
#endif
|
||||
vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _))
|
||||
vector(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && _))
|
||||
: vec(BOOST_PP_ENUM(N, FUSION_FORWARD_CTOR_MOVE, _)) {}
|
||||
#endif
|
||||
|
||||
|
@ -9,13 +9,13 @@
|
||||
#if !defined(FUSION_MACRO_05042005)
|
||||
#define FUSION_MACRO_05042005
|
||||
|
||||
#define FUSION_VECTOR_MEMBER_MEMBER_DEFAULT_INIT(z, n, _) m##n()
|
||||
#define FUSION_VECTOR_MEMBER_MEMBER_INIT(z, n, _) m##n(_##n)
|
||||
#define FUSION_VECTOR_MEMBER_DEFAULT_INIT(z, n, _) m##n()
|
||||
#define FUSION_VECTOR_MEMBER_INIT(z, n, _) m##n(_##n)
|
||||
#define FUSION_VECTOR_MEMBER_COPY_INIT(z, n, _) m##n(other.m##n)
|
||||
#define FUSION_VECTOR_MEMBER_FWD(z, n, _) m##n(std::forward<T##n>(other.m##n))
|
||||
#define FUSION_VECTOR_ARG_FWD(z, n, _) m##n(std::forward<T##n>(_##n))
|
||||
#define FUSION_VECTOR_ARG_FWD(z, n, _) m##n(std::forward<U##n>(_##n))
|
||||
#define FUSION_VECTOR_MEMBER_MEMBER_DECL(z, n, _) T##n m##n;
|
||||
#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) std::forward<T##n>(_##n)
|
||||
#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) std::forward<U##n>(_##n)
|
||||
|
||||
#define FUSION_VECTOR_MEMBER_MEMBER_ASSIGN(z, n, _) \
|
||||
this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n);
|
||||
@ -47,17 +47,18 @@
|
||||
struct BOOST_PP_CAT(vector_data, N)
|
||||
{
|
||||
BOOST_PP_CAT(vector_data, N)()
|
||||
: BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_MEMBER_DEFAULT_INIT, _) {}
|
||||
: BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_DEFAULT_INIT, _) {}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _))
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
|
||||
BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && _))
|
||||
: BOOST_PP_ENUM(N, FUSION_VECTOR_ARG_FWD, _) {}
|
||||
#endif
|
||||
|
||||
BOOST_PP_CAT(vector_data, N)(
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(
|
||||
N, typename detail::call_param<T, >::type _))
|
||||
: BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_MEMBER_INIT, _) {}
|
||||
: BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_INIT, _) {}
|
||||
|
||||
BOOST_PP_CAT(vector_data, N)(
|
||||
BOOST_PP_CAT(vector_data, N) const& other)
|
||||
@ -124,16 +125,24 @@
|
||||
: base_type(BOOST_PP_ENUM_PARAMS(N, _)) {}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
|
||||
#if (N == 1)
|
||||
explicit
|
||||
#endif
|
||||
BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _))
|
||||
BOOST_PP_CAT(vector, N)(U0&& _0
|
||||
, typename boost::enable_if<is_convertible<U0, T0> >::type* /*dummy*/ = 0
|
||||
)
|
||||
: base_type(std::forward<U0>(_0)) {}
|
||||
#else
|
||||
BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && _))
|
||||
: base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, _)) {}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs)
|
||||
: base_type(std::forward<base_type>(rhs)) {}
|
||||
|
||||
BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) const& rhs)
|
||||
: base_type(rhs) {}
|
||||
|
||||
#endif
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
|
||||
@ -179,6 +188,13 @@
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_PP_CAT(vector, N)&
|
||||
operator=(BOOST_PP_CAT(vector, N) const& vec)
|
||||
{
|
||||
base_type::operator=(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_PP_CAT(vector, N)&
|
||||
operator=(BOOST_PP_CAT(vector, N)&& vec)
|
||||
{
|
||||
|
Reference in New Issue
Block a user