File indexing completed on 2025-01-18 09:31:08
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEFINE_STRUCT_HPP
0009 #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEFINE_STRUCT_HPP
0010
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/config.hpp>
0013 #include <boost/detail/workaround.hpp>
0014 #include <boost/fusion/sequence/intrinsic/begin.hpp>
0015 #include <boost/fusion/iterator/deref.hpp>
0016 #include <boost/fusion/iterator/next.hpp>
0017 #include <boost/fusion/iterator/advance.hpp>
0018 #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
0019 #include <boost/fusion/adapted/struct/detail/namespace.hpp>
0020 #include <boost/preprocessor/if.hpp>
0021 #include <boost/preprocessor/expr_if.hpp>
0022 #include <boost/preprocessor/dec.hpp>
0023 #include <boost/preprocessor/logical/not.hpp>
0024 #include <boost/preprocessor/punctuation/comma_if.hpp>
0025 #include <boost/preprocessor/seq/seq.hpp>
0026 #include <boost/preprocessor/seq/for_each.hpp>
0027 #include <boost/preprocessor/seq/for_each_i.hpp>
0028 #include <boost/preprocessor/seq/enum.hpp>
0029 #include <boost/preprocessor/seq/size.hpp>
0030 #include <boost/preprocessor/tuple/elem.hpp>
0031 #include <boost/preprocessor/tuple/eat.hpp>
0032 #include <boost/call_traits.hpp>
0033 #include <boost/type_traits/is_convertible.hpp>
0034 #include <boost/utility/enable_if.hpp>
0035
0036 #define BOOST_FUSION_DEFINE_STRUCT_FILLER_0(X, Y) \
0037 ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_1
0038 #define BOOST_FUSION_DEFINE_STRUCT_FILLER_1(X, Y) \
0039 ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_0
0040 #define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END
0041 #define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END
0042
0043 #ifdef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
0044
0045 #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \
0046 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0047 \
0048 BOOST_PP_COMMA_IF(I) \
0049 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
0050 other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE))
0051
0052 #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
0053 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0054 \
0055 BOOST_FUSION_GPU_ENABLED \
0056 NAME(self_type const& other_self) \
0057 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0058 1, \
0059 BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
0060 ATTRIBUTE_TUPLE_SIZE, \
0061 ATTRIBUTES_SEQ) \
0062 {}
0063
0064
0065 #define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I( \
0066 R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
0067 \
0068 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \
0069 other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
0070
0071 #define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
0072 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0073 \
0074 BOOST_FUSION_GPU_ENABLED \
0075 self_type& operator=(self_type const& other) \
0076 { \
0077 BOOST_PP_SEQ_FOR_EACH_I_R( \
0078 1, \
0079 BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I, \
0080 ATTRIBUTE_TUPLE_SIZE, \
0081 ATTRIBUTES_SEQ) \
0082 \
0083 return *this; \
0084 }
0085
0086 #else
0087
0088 #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
0089 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0090 \
0091 BOOST_FUSION_GPU_ENABLED NAME(self_type const&) = default;
0092
0093 #define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
0094 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0095 \
0096 BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type const&) = default;
0097
0098 #endif
0099
0100 #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
0101 R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
0102 \
0103 BOOST_PP_EXPR_IF( \
0104 I_, \
0105 typedef typename \
0106 boost::fusion::result_of::next< \
0107 BOOST_PP_CAT(I,BOOST_PP_DEC(I_)) \
0108 >::type \
0109 BOOST_PP_CAT(I,I_); \
0110 BOOST_PP_CAT(I,I_) BOOST_PP_CAT(i,I_)= \
0111 boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \
0112 ) \
0113 \
0114 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \
0115 boost::fusion::deref(BOOST_PP_CAT(i,I_));
0116
0117 #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \
0118 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0119 \
0120 template<typename Seq> \
0121 BOOST_FUSION_GPU_ENABLED \
0122 self_type& \
0123 operator=(Seq const& seq) \
0124 { \
0125 typedef typename \
0126 boost::fusion::result_of::begin<Seq const>::type \
0127 I0; \
0128 I0 i0=boost::fusion::begin(seq); \
0129 \
0130 BOOST_PP_SEQ_FOR_EACH_I_R( \
0131 1, \
0132 BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \
0133 ATTRIBUTE_TUPLE_SIZE, \
0134 ATTRIBUTES_SEQ) \
0135 \
0136 return *this; \
0137 }
0138
0139 #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
0140
0141 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR(NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0142 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0143
0144 #else
0145
0146 #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
0147 || BOOST_WORKAROUND(BOOST_GCC, < 40500) \
0148 || BOOST_WORKAROUND(BOOST_MSVC, == 1800)
0149
0150 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I( \
0151 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0152 \
0153 BOOST_PP_COMMA_IF(I) \
0154 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(std::move( \
0155 other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)))
0156
0157 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
0158 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0159 \
0160 BOOST_FUSION_GPU_ENABLED \
0161 NAME(self_type&& other_self) \
0162 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0163 1, \
0164 BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I, \
0165 ATTRIBUTE_TUPLE_SIZE, \
0166 ATTRIBUTES_SEQ) \
0167 {}
0168
0169 #else
0170
0171 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
0172 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0173 \
0174 BOOST_FUSION_GPU_ENABLED NAME(self_type&&) = default;
0175
0176 #endif
0177
0178 #if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
0179 || BOOST_WORKAROUND(BOOST_GCC, < 40600) \
0180 || BOOST_WORKAROUND(BOOST_MSVC, == 1800)
0181
0182 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I( \
0183 R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
0184 \
0185 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)=std::move( \
0186 other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE));
0187
0188 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
0189 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0190 \
0191 BOOST_FUSION_GPU_ENABLED \
0192 self_type& operator=(self_type&& other) \
0193 { \
0194 BOOST_PP_SEQ_FOR_EACH_I_R( \
0195 1, \
0196 BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I, \
0197 ATTRIBUTE_TUPLE_SIZE, \
0198 ATTRIBUTES_SEQ) \
0199 \
0200 return *this; \
0201 }
0202
0203 #else
0204
0205 #define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
0206 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0207 \
0208 BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type&&) = default;
0209
0210 #endif
0211
0212 #endif
0213
0214 #define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPLE_SIZE, ATTRIBUTE) \
0215 \
0216 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
0217 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
0218
0219 #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \
0220 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0221 \
0222 BOOST_PP_COMMA_IF(I) \
0223 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
0224 boost::fusion::deref(boost::fusion::advance_c<I>(boost::fusion::begin( \
0225 seq))))
0226
0227 #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \
0228 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0229 \
0230 , typename boost::disable_if< \
0231 boost::is_convertible< \
0232 Seq const& \
0233 , BOOST_PP_TUPLE_ELEM( \
0234 ATTRIBUTE_TUPLE_SIZE, \
0235 0, \
0236 BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
0237 > \
0238 >::type* =0
0239
0240 #define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \
0241 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0242 \
0243 BOOST_PP_COMMA_IF(I) \
0244 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)()
0245
0246 #define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
0247 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0248 \
0249 BOOST_PP_SEQ_FOR_EACH_R( \
0250 1, \
0251 BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \
0252 ATTRIBUTE_TUPLE_SIZE, \
0253 ATTRIBUTES_SEQ) \
0254 \
0255 BOOST_FUSION_GPU_ENABLED \
0256 NAME() \
0257 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0258 1, \
0259 BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \
0260 ATTRIBUTE_TUPLE_SIZE, \
0261 ATTRIBUTES_SEQ) \
0262 {} \
0263 \
0264 BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
0265 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0266 BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
0267 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0268 \
0269 template<typename Seq> \
0270 BOOST_FUSION_GPU_ENABLED \
0271 NAME(Seq const& seq \
0272 BOOST_PP_IF( \
0273 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
0274 BOOST_PP_TUPLE_EAT(2), \
0275 BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \
0276 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0277 ) \
0278 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0279 1, \
0280 BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \
0281 ATTRIBUTE_TUPLE_SIZE, \
0282 ATTRIBUTES_SEQ) \
0283 {} \
0284 \
0285 BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
0286 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0287 BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
0288 ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0289 BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0290
0291 #define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
0292 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0293 \
0294 BOOST_FUSION_GPU_ENABLED \
0295 explicit \
0296 NAME(boost::call_traits< \
0297 BOOST_PP_TUPLE_ELEM( \
0298 ATTRIBUTE_TUPLE_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
0299 >::param_type arg) \
0300 : BOOST_PP_TUPLE_ELEM( \
0301 ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
0302 {}
0303
0304 #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \
0305 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0306 \
0307 BOOST_FUSION_GPU_ENABLED \
0308 explicit \
0309 NAME(typename boost::call_traits< \
0310 typename boost::fusion::detail::get_first_arg< \
0311 BOOST_PP_TUPLE_ELEM( \
0312 ATTRIBUTE_TUPLE_SIZE, \
0313 0, \
0314 BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
0315 , BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
0316 >::type \
0317 >::param_type arg) \
0318 : BOOST_PP_TUPLE_ELEM( \
0319 ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
0320 {}
0321
0322 #define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \
0323 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0324 \
0325 BOOST_PP_COMMA_IF(I) \
0326 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I))
0327
0328 #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \
0329 \
0330 BOOST_PP_COMMA_IF(I) \
0331 typename boost::call_traits< \
0332 typename boost::fusion::detail::get_first_arg< \
0333 BOOST_PP_TUPLE_ELEM( \
0334 BOOST_PP_TUPLE_ELEM(3,0,DATA), \
0335 0, \
0336 ATTRIBUTE) \
0337 , BOOST_PP_TUPLE_ELEM(3,2,DATA) \
0338 >::type \
0339 >::param_type BOOST_PP_CAT(_,I)
0340
0341 #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \
0342 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0343 \
0344 BOOST_FUSION_GPU_ENABLED \
0345 NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
0346 1, \
0347 BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
0348 ( \
0349 ATTRIBUTE_TUPLE_SIZE, \
0350 BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
0351 BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
0352 ), \
0353 ATTRIBUTES_SEQ)) \
0354 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0355 1, \
0356 BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
0357 ATTRIBUTE_TUPLE_SIZE, \
0358 ATTRIBUTES_SEQ) \
0359 {}
0360
0361 #define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \
0362 R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
0363 \
0364 BOOST_PP_COMMA_IF(I) \
0365 boost::call_traits< \
0366 BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
0367 >::param_type BOOST_PP_CAT(_,I)
0368
0369 #define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
0370 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0371 \
0372 BOOST_FUSION_GPU_ENABLED \
0373 NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
0374 1, \
0375 BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
0376 ATTRIBUTE_TUPLE_SIZE, \
0377 ATTRIBUTES_SEQ)) \
0378 : BOOST_PP_SEQ_FOR_EACH_I_R( \
0379 1, \
0380 BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
0381 ATTRIBUTE_TUPLE_SIZE, \
0382 ATTRIBUTES_SEQ) \
0383 {}
0384
0385 #define BOOST_FUSION_DEFINE_STRUCT_CTOR( \
0386 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0387 \
0388 BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
0389 BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \
0390 BOOST_FUSION_DEFINE_STRUCT_CTOR_1)( \
0391 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0392
0393 #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
0394 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0395 \
0396 BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
0397 BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \
0398 BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1)( \
0399 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0400
0401 #define BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL( \
0402 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0403 \
0404 BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
0405 NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \
0406 \
0407 BOOST_FUSION_DEFINE_STRUCT_CTOR( \
0408 NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE)
0409
0410 #define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
0411 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0412
0413 #define BOOST_FUSION_DEFINE_STRUCT_IMPL( \
0414 NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0415 \
0416 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
0417 \
0418 struct NAME \
0419 { \
0420 typedef NAME self_type; \
0421 \
0422 BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
0423 BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL, \
0424 BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL)( \
0425 NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0426 }; \
0427 \
0428 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
0429
0430 #define BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL( \
0431 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
0432 \
0433 BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
0434 NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \
0435 \
0436 BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
0437 TEMPLATE_PARAMS_SEQ, \
0438 NAME, \
0439 BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \
0440 ATTRIBUTE_TUPLE_SIZE)
0441
0442 #define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \
0443 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
0444
0445 #define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
0446 TEMPLATE_PARAMS_SEQ, \
0447 NAMESPACE_SEQ, \
0448 NAME, \
0449 ATTRIBUTES_SEQ, \
0450 ATTRIBUTE_TUPLE_SIZE) \
0451 \
0452 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
0453 \
0454 template< \
0455 BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL( \
0456 (0)TEMPLATE_PARAMS_SEQ) \
0457 > \
0458 struct NAME \
0459 { \
0460 typedef NAME self_type; \
0461 \
0462 BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
0463 BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL, \
0464 BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL)( \
0465 TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)\
0466 }; \
0467 \
0468 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
0469
0470 namespace boost { namespace fusion { namespace detail
0471 {
0472 template<typename A1, typename A2>
0473 struct get_first_arg
0474 {
0475 typedef A1 type;
0476 };
0477 }}}
0478
0479 #endif