Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:40

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 // No include guard. This file is meant to be included many times
0008 
0009 #if !defined(FUSION_MACRO_05042005)
0010 #define FUSION_MACRO_05042005
0011 
0012 #define FUSION_VECTOR_CTOR_DEFAULT_INIT(z, n, _)                                \
0013     m##n()
0014 
0015 #define FUSION_VECTOR_CTOR_INIT(z, n, _)                                        \
0016     m##n(_##n)
0017 
0018 #define FUSION_VECTOR_MEMBER_CTOR_INIT(z, n, _)                                 \
0019     m##n(other.m##n)
0020 
0021 #define FUSION_VECTOR_CTOR_FORWARD(z, n, _)                                     \
0022    m##n(BOOST_FUSION_FWD_ELEM(T##n, other.m##n))
0023 
0024 #define FUSION_VECTOR_CTOR_ARG_FWD(z, n, _)                                     \
0025    m##n(BOOST_FUSION_FWD_ELEM(U##n, _##n))
0026 
0027 #define FUSION_VECTOR_MEMBER_DECL(z, n, _)                                      \
0028     T##n m##n;
0029 
0030 #define FUSION_VECTOR_MEMBER_FORWARD(z, n, _)                                   \
0031    BOOST_FUSION_FWD_ELEM(U##n, _##n)
0032 
0033 #define FUSION_VECTOR_MEMBER_ASSIGN(z, n, _)                                    \
0034     this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n);
0035 
0036 #define FUSION_VECTOR_MEMBER_DEREF_ASSIGN(z, n, _)                              \
0037     this->BOOST_PP_CAT(m, n) = *BOOST_PP_CAT(i, n);
0038 
0039 #define FUSION_VECTOR_MEMBER_MOVE(z, n, _)                                      \
0040     this->BOOST_PP_CAT(m, n) = std::forward<                                    \
0041         BOOST_PP_CAT(T, n)>(vec.BOOST_PP_CAT(m, n));
0042 
0043 #define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _)                                   \
0044     BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED                              \
0045         typename add_reference<T##n>::type                                      \
0046         at_impl(mpl::int_<n>) { return this->m##n; }                            \
0047     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED                                    \
0048         typename add_reference<typename add_const<T##n>::type>::type            \
0049         at_impl(mpl::int_<n>) const { return this->m##n; }
0050 
0051 #define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _)                             \
0052     typedef typename result_of::next<                                           \
0053         BOOST_PP_CAT(I, BOOST_PP_DEC(n))>::type BOOST_PP_CAT(I, n);             \
0054     BOOST_PP_CAT(I, n) BOOST_PP_CAT(i, n)                                       \
0055         = fusion::next(BOOST_PP_CAT(i, BOOST_PP_DEC(n)));
0056 
0057 #endif
0058 
0059 #define N BOOST_PP_ITERATION()
0060 
0061     template <BOOST_PP_ENUM_PARAMS(N, typename T)>
0062     struct BOOST_PP_CAT(vector_data, N)
0063     {
0064         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0065         BOOST_PP_CAT(vector_data, N)()
0066             : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_DEFAULT_INIT, _) {}
0067 
0068 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0069 FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0070 #endif
0071 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
0072     (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
0073         template <BOOST_PP_ENUM_PARAMS(N, typename U)>
0074 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0075 FUSION_HASH if !defined(BOOST_CLANG)
0076         BOOST_CXX14_CONSTEXPR
0077 FUSION_HASH endif
0078 #else
0079 #if !defined(BOOST_CLANG)
0080         BOOST_CXX14_CONSTEXPR
0081 #endif
0082 #endif
0083         BOOST_FUSION_GPU_ENABLED
0084         BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg)
0085           , typename boost::enable_if<is_convertible<U0, T0> >::type* /*dummy*/ = 0
0086         )
0087             : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_ARG_FWD, arg) {}
0088 
0089         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0090         BOOST_PP_CAT(vector_data, N)(
0091             BOOST_PP_CAT(vector_data, N)&& other)
0092             : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_FORWARD, arg) {}
0093 #endif
0094 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0095 FUSION_HASH endif
0096 #endif
0097 
0098 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0099 FUSION_HASH if !defined(BOOST_CLANG)
0100     BOOST_CONSTEXPR
0101 FUSION_HASH endif
0102 #else
0103 #if !defined(BOOST_CLANG)
0104     BOOST_CONSTEXPR
0105 #endif
0106 #endif
0107         BOOST_FUSION_GPU_ENABLED
0108         BOOST_PP_CAT(vector_data, N)(
0109             BOOST_PP_ENUM_BINARY_PARAMS(
0110                 N, typename detail::call_param<T, >::type arg))
0111             : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_INIT, arg) {}
0112 
0113         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0114         BOOST_PP_CAT(vector_data, N)(
0115             BOOST_PP_CAT(vector_data, N) const& other)
0116             : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_CTOR_INIT, _) {}
0117 
0118         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0119         BOOST_PP_CAT(vector_data, N)&
0120         operator=(BOOST_PP_CAT(vector_data, N) const& vec)
0121         {
0122             BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _)
0123             return *this;
0124         }
0125 
0126         template <typename Sequence>
0127 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0128 FUSION_HASH if !defined(BOOST_CLANG)
0129     BOOST_CXX14_CONSTEXPR
0130 FUSION_HASH endif
0131 #else
0132 #if !defined(BOOST_CLANG)
0133     BOOST_CXX14_CONSTEXPR
0134 #endif
0135 #endif
0136         BOOST_FUSION_GPU_ENABLED
0137         static BOOST_PP_CAT(vector_data, N)
0138         init_from_sequence(Sequence const& seq)
0139         {
0140             typedef typename result_of::begin<Sequence const>::type I0;
0141             I0 i0 = fusion::begin(seq);
0142             BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _)
0143             return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i));
0144         }
0145 
0146         template <typename Sequence>
0147 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0148 FUSION_HASH if !defined(BOOST_CLANG)
0149     BOOST_CXX14_CONSTEXPR
0150 FUSION_HASH endif
0151 #else
0152 #if !defined(BOOST_CLANG)
0153     BOOST_CXX14_CONSTEXPR
0154 #endif
0155 #endif
0156         BOOST_FUSION_GPU_ENABLED
0157         static BOOST_PP_CAT(vector_data, N)
0158         init_from_sequence(Sequence& seq)
0159         {
0160             typedef typename result_of::begin<Sequence>::type I0;
0161             I0 i0 = fusion::begin(seq);
0162             BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _)
0163             return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i));
0164         }
0165 
0166         BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DECL, _)
0167     };
0168 
0169     template <BOOST_PP_ENUM_PARAMS(N, typename T)>
0170     struct BOOST_PP_CAT(vector, N)
0171       : BOOST_PP_CAT(vector_data, N)<BOOST_PP_ENUM_PARAMS(N, T)>
0172       , sequence_base<BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, T)> >
0173     {
0174         typedef BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, T)> this_type;
0175         typedef BOOST_PP_CAT(vector_data, N)<BOOST_PP_ENUM_PARAMS(N, T)> base_type;
0176         typedef mpl::BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, T)> types;
0177         typedef vector_tag fusion_tag;
0178         typedef fusion_sequence_tag tag; // this gets picked up by MPL
0179         typedef mpl::false_ is_view;
0180         typedef random_access_traversal_tag category;
0181         typedef mpl::int_<N> size;
0182 
0183         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0184         BOOST_PP_CAT(vector, N)() {}
0185 
0186 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0187 FUSION_HASH if !defined(BOOST_CLANG)
0188     BOOST_CONSTEXPR
0189 FUSION_HASH endif
0190 #else
0191 #if !defined(BOOST_CLANG)
0192     BOOST_CONSTEXPR
0193 #endif
0194 #endif
0195         BOOST_FUSION_GPU_ENABLED
0196 #if (N == 1)
0197         explicit
0198 #endif
0199         BOOST_PP_CAT(vector, N)(
0200             BOOST_PP_ENUM_BINARY_PARAMS(
0201                 N, typename detail::call_param<T, >::type arg))
0202             : base_type(BOOST_PP_ENUM_PARAMS(N, arg)) {}
0203 
0204 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0205 FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0206 #endif
0207 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
0208     (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
0209         template <BOOST_PP_ENUM_PARAMS(N, typename U)>
0210 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0211 FUSION_HASH if !defined(BOOST_CLANG)
0212         BOOST_CXX14_CONSTEXPR
0213 FUSION_HASH endif
0214 #else
0215 #if !defined(BOOST_CLANG)
0216         BOOST_CXX14_CONSTEXPR
0217 #endif
0218 #endif
0219         BOOST_FUSION_GPU_ENABLED
0220 #if (N == 1)
0221         explicit
0222         BOOST_PP_CAT(vector, N)(U0&& _0
0223           , typename boost::enable_if<is_convertible<U0, T0> >::type* /*dummy*/ = 0
0224           )
0225          : base_type(BOOST_FUSION_FWD_ELEM(U0, _0)) {}
0226 #else
0227         BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg))
0228             : base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, arg)) {}
0229 #endif
0230 
0231         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0232         BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs)
0233             : base_type(std::forward<base_type>(rhs)) {}
0234 
0235         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0236         BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) const& rhs)
0237             : base_type(static_cast<base_type const&>(rhs)) {}
0238 
0239         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0240         BOOST_PP_CAT(vector, N)&
0241         operator=(BOOST_PP_CAT(vector, N) const& vec)
0242         {
0243             base_type::operator=(vec);
0244             return *this;
0245         }
0246 
0247         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0248         BOOST_PP_CAT(vector, N)&
0249         operator=(BOOST_PP_CAT(vector, N)&& vec)
0250         {
0251             BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MOVE, _)
0252             return *this;
0253         }
0254 #endif
0255 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0256 FUSION_HASH endif
0257 #endif
0258 
0259         template <BOOST_PP_ENUM_PARAMS(N, typename U)>
0260 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0261 FUSION_HASH if !defined(BOOST_CLANG)
0262     BOOST_CXX14_CONSTEXPR
0263 FUSION_HASH endif
0264 #else
0265 #if !defined(BOOST_CLANG)
0266     BOOST_CXX14_CONSTEXPR
0267 #endif
0268 #endif
0269         BOOST_FUSION_GPU_ENABLED
0270         BOOST_PP_CAT(vector, N)(
0271             BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec)
0272             : base_type(BOOST_PP_ENUM_PARAMS(N, vec.m)) {}
0273 
0274         template <typename Sequence>
0275 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0276 FUSION_HASH if !defined(BOOST_CLANG)
0277         BOOST_CXX14_CONSTEXPR
0278 FUSION_HASH endif
0279 #else
0280 #if !defined(BOOST_CLANG)
0281         BOOST_CXX14_CONSTEXPR
0282 #endif
0283 #endif
0284         BOOST_FUSION_GPU_ENABLED
0285         BOOST_PP_CAT(vector, N)(
0286             Sequence const& seq
0287           , typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0
0288 #if (N == 1)
0289           , typename boost::disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0
0290 #endif
0291             )
0292             : base_type(base_type::init_from_sequence(seq)) {}
0293 
0294         template <typename Sequence>
0295 #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
0296 FUSION_HASH if !defined(BOOST_CLANG)
0297         BOOST_CXX14_CONSTEXPR
0298 FUSION_HASH endif
0299 #else
0300 #if !defined(BOOST_CLANG)
0301         BOOST_CXX14_CONSTEXPR
0302 #endif
0303 #endif
0304         BOOST_FUSION_GPU_ENABLED
0305         BOOST_PP_CAT(vector, N)(
0306             Sequence& seq
0307           , typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0
0308 #if (N == 1)
0309           , typename boost::disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0
0310 #endif
0311             )
0312             : base_type(base_type::init_from_sequence(seq)) {}
0313 
0314         template <BOOST_PP_ENUM_PARAMS(N, typename U)>
0315         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0316         BOOST_PP_CAT(vector, N)&
0317         operator=(BOOST_PP_CAT(vector, N)<BOOST_PP_ENUM_PARAMS(N, U)> const& vec)
0318         {
0319             BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_ASSIGN, _)
0320             return *this;
0321         }
0322 
0323         template <typename Sequence>
0324         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0325         typename boost::disable_if<is_convertible<Sequence, T0>, this_type&>::type
0326         operator=(Sequence const& seq)
0327         {
0328             typedef typename result_of::begin<Sequence const>::type I0;
0329             I0 i0 = fusion::begin(seq);
0330             BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _)
0331             BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DEREF_ASSIGN, _)
0332             return *this;
0333         }
0334 
0335         BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _)
0336 
0337         template<typename I>
0338         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0339         typename add_reference<typename mpl::at<types, I>::type>::type
0340         at_impl(I)
0341         {
0342             return this->at_impl(mpl::int_<I::value>());
0343         }
0344 
0345         template<typename I>
0346         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0347         typename add_reference<typename add_const<typename mpl::at<types, I>::type>::type>::type
0348         at_impl(I) const
0349         {
0350             return this->at_impl(mpl::int_<I::value>());
0351         }
0352     };
0353 
0354 #undef N