diff options
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp | 146 |
1 files changed, 102 insertions, 44 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp b/3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp index 539b47f..89c6f03 100644 --- a/3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp +++ b/3rdParty/Boost/src/boost/fusion/container/vector/detail/vector_n.hpp @@ -9,28 +9,41 @@ #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_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_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_MEMBER_ASSIGN(z, n, _) \ +#define FUSION_VECTOR_CTOR_DEFAULT_INIT(z, n, _) \ + m##n() + +#define FUSION_VECTOR_CTOR_INIT(z, n, _) \ + m##n(_##n) + +#define FUSION_VECTOR_MEMBER_CTOR_INIT(z, n, _) \ + m##n(other.m##n) + +#define FUSION_VECTOR_CTOR_FORWARD(z, n, _) \ + m##n(std::forward<T##n>(other.m##n)) + +#define FUSION_VECTOR_CTOR_ARG_FWD(z, n, _) \ + m##n(std::forward<U##n>(_##n)) + +#define FUSION_VECTOR_MEMBER_DECL(z, n, _) \ + T##n m##n; + +#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) \ + std::forward<U##n>(_##n) + +#define FUSION_VECTOR_MEMBER_ASSIGN(z, n, _) \ this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n); -#define FUSION_VECTOR_MEMBER_DEREF_MEMBER_ASSIGN(z, n, _) \ +#define FUSION_VECTOR_MEMBER_DEREF_ASSIGN(z, n, _) \ this->BOOST_PP_CAT(m, n) = *BOOST_PP_CAT(i, n); -#define FUSION_VECTOR_MEMBER_MEMBER_FORWARD(z, n, _) \ +#define FUSION_VECTOR_MEMBER_MOVE(z, n, _) \ this->BOOST_PP_CAT(m, n) = std::forward< \ BOOST_PP_CAT(T, n)>(vec.BOOST_PP_CAT(m, n)); #define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _) \ - typename add_reference<T##n>::type \ + BOOST_FUSION_GPU_ENABLED typename add_reference<T##n>::type \ at_impl(mpl::int_<n>) { return this->m##n; } \ - typename add_reference<typename add_const<T##n>::type>::type \ + BOOST_FUSION_GPU_ENABLED typename add_reference<typename add_const<T##n>::type>::type \ at_impl(mpl::int_<n>) const { return this->m##n; } #define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _) \ @@ -46,37 +59,50 @@ template <BOOST_PP_ENUM_PARAMS(N, typename T)> struct BOOST_PP_CAT(vector_data, N) { + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)() - : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_MEMBER_DEFAULT_INIT, _) {} + : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_DEFAULT_INIT, _) {} -#if !defined(BOOST_NO_RVALUE_REFERENCES) - BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _)) - : BOOST_PP_ENUM(N, FUSION_VECTOR_ARG_FWD, _) {} +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#endif +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ + (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) + template <BOOST_PP_ENUM_PARAMS(N, typename U)> + BOOST_FUSION_GPU_ENABLED + BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && _) + , typename boost::enable_if<is_convertible<U0, T0> >::type* /*dummy*/ = 0 + ) + : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_ARG_FWD, _) {} + BOOST_PP_CAT(vector_data, N)( + BOOST_PP_CAT(vector_data, N)&& other) + : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_FORWARD, _) {} +#endif +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH endif #endif + BOOST_FUSION_GPU_ENABLED 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_CTOR_INIT, _) {} + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N) const& other) - : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_COPY_INIT, _) {} - -#if !defined(BOOST_NO_RVALUE_REFERENCES) - BOOST_PP_CAT(vector_data, N)( - BOOST_PP_CAT(vector_data, N)&& other) - : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FWD, _) {} -#endif + : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_CTOR_INIT, _) {} + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)& operator=(BOOST_PP_CAT(vector_data, N) const& vec) { - BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_ASSIGN, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _) return *this; } template <typename Sequence> + BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence const& seq) { @@ -87,6 +113,7 @@ } template <typename Sequence> + BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence& seq) { @@ -96,7 +123,7 @@ return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); } - BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_DECL, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DECL, _) }; template <BOOST_PP_ENUM_PARAMS(N, typename T)> @@ -113,8 +140,10 @@ typedef random_access_traversal_tag category; typedef mpl::int_<N> size; + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)() {} + BOOST_FUSION_GPU_ENABLED #if (N == 1) explicit #endif @@ -123,25 +152,60 @@ N, typename detail::call_param<T, >::type _)) : base_type(BOOST_PP_ENUM_PARAMS(N, _)) {} -#if !defined(BOOST_NO_RVALUE_REFERENCES) +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#endif +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ + (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) + template <BOOST_PP_ENUM_PARAMS(N, typename U)> + BOOST_FUSION_GPU_ENABLED #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_RVALUE_REFERENCES) + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs) : base_type(std::forward<base_type>(rhs)) {} + + BOOST_FUSION_GPU_ENABLED + BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) const& rhs) + : base_type(static_cast<base_type const&>(rhs)) {} + + BOOST_FUSION_GPU_ENABLED + BOOST_PP_CAT(vector, N)& + operator=(BOOST_PP_CAT(vector, N) const& vec) + { + base_type::operator=(vec); + return *this; + } + + BOOST_FUSION_GPU_ENABLED + BOOST_PP_CAT(vector, N)& + operator=(BOOST_PP_CAT(vector, N)&& vec) + { + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MOVE, _) + return *this; + } +#endif +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH endif #endif template <BOOST_PP_ENUM_PARAMS(N, typename U)> + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec) : base_type(BOOST_PP_ENUM_PARAMS(N, vec.m)) {} template <typename Sequence> + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence const& seq #if (N == 1) @@ -151,6 +215,7 @@ : base_type(base_type::init_from_sequence(seq)) {} template <typename Sequence> + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence& seq #if (N == 1) @@ -160,36 +225,30 @@ : base_type(base_type::init_from_sequence(seq)) {} template <BOOST_PP_ENUM_PARAMS(N, typename U)> + BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec) { - BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_ASSIGN, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _) return *this; } template <typename Sequence> + BOOST_FUSION_GPU_ENABLED typename boost::disable_if<is_convertible<Sequence, T0>, this_type&>::type operator=(Sequence const& seq) { typedef typename result_of::begin<Sequence const>::type I0; I0 i0 = fusion::begin(seq); BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) - BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DEREF_MEMBER_ASSIGN, _) - return *this; - } - -#if !defined(BOOST_NO_RVALUE_REFERENCES) - BOOST_PP_CAT(vector, N)& - operator=(BOOST_PP_CAT(vector, N)&& vec) - { - BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_FORWARD, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DEREF_ASSIGN, _) return *this; } -#endif BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _) template<typename I> + BOOST_FUSION_GPU_ENABLED typename add_reference<typename mpl::at<types, I>::type>::type at_impl(I) { @@ -197,6 +256,7 @@ } template<typename I> + BOOST_FUSION_GPU_ENABLED typename add_reference<typename add_const<typename mpl::at<types, I>::type>::type>::type at_impl(I) const { @@ -205,5 +265,3 @@ }; #undef N - - |