Merge pull request #124 from Flast/feature/ticket-11157-remove-BOOST_PP_IS_EMPTY

Remove use of BOOST_PP_IS_EMPTY.
This commit is contained in:
Joel de Guzman
2016-02-17 04:45:16 +08:00
32 changed files with 292 additions and 256 deletions

View File

@ -227,7 +227,7 @@ __random_access_sequence__.
struct_name, struct_name,
(member_type0, member_name0) (member_type0, member_name0)
(member_type1, member_name1) (member_type1, member_name1)
(BOOST_FUSION_ADAPT_AUTO, member_name2) (auto, member_name2)
... ...
) )
@ -240,7 +240,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)`
pairs declares the type and names of each of the struct members that are part of pairs declares the type and names of each of the struct members that are part of
the sequence. the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macro should be used at global scope, and `struct_name` should be the fully The macro should be used at global scope, and `struct_name` should be the fully
@ -270,8 +270,8 @@ namespace qualified name of the struct to be adapted.
// Without BOOST_PP_VARIADICS support : // Without BOOST_PP_VARIADICS support :
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(
demo::employee, demo::employee,
(BOOST_FUSION_ADAPT_AUTO, name) (auto, name)
(BOOST_FUSION_ADAPT_AUTO, age) (auto, age)
) )
[endsect] [endsect]
@ -298,7 +298,7 @@ __random_access_sequence__.
(struct_name) (specialization_param0)(specialization_param1)..., (struct_name) (specialization_param0)(specialization_param1)...,
(member_type0, member_name0) (member_type0, member_name0)
(member_type1, member_name1) (member_type1, member_name1)
(BOOST_FUSION_ADAPT_AUTO, member_name2), (auto, member_name2),
... ...
) )
@ -316,7 +316,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)`
pairs declares the type and names of each of the struct members that are part of pairs declares the type and names of each of the struct members that are part of
the sequence. the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macro should be used at global scope, and `struct_name` should be the fully The macro should be used at global scope, and `struct_name` should be the fully
@ -345,7 +345,7 @@ namespace qualified name of the struct to be adapted.
(demo::employee) (Name)(Age), (demo::employee) (Name)(Age),
(Name, name) (Name, name)
(Age, age) (Age, age)
(BOOST_FUSION_ADAPT_AUTO, employment_timestamp)) (auto, employment_timestamp))
// Or by infering type completely // Or by infering type completely
BOOST_FUSION_ADAPT_TPL_STRUCT( BOOST_FUSION_ADAPT_TPL_STRUCT(
@ -390,7 +390,7 @@ adapted using the given name.
struct_name, adapted_name, struct_name, adapted_name,
(member_type0, member_name0) (member_type0, member_name0)
(member_type1, member_name1) (member_type1, member_name1)
(BOOST_FUSION_ADAPT_AUTO, member_name2), (auto, member_name2),
... ...
) )
@ -400,7 +400,7 @@ adapted using the given name.
adapted_name, adapted_name,
(member_type0, member_name0) (member_type0, member_name0)
(member_type1, member_name1) (member_type1, member_name1)
(BOOST_FUSION_ADAPT_AUTO, member_name2), (auto, member_name2),
... ...
) )
@ -422,7 +422,7 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)`
pairs declares the type and names of each of the struct members that are part of pairs declares the type and names of each of the struct members that are part of
the sequence. the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macros should be used at global scope, and `struct_name` should be the fully The macros should be used at global scope, and `struct_name` should be the fully
@ -453,8 +453,8 @@ namespace qualified name of the struct to be converted.
// Without BOOST_PP_VARIADICS support : // Without BOOST_PP_VARIADICS support :
BOOST_FUSION_ADAPT_STRUCT_NAMED( BOOST_FUSION_ADAPT_STRUCT_NAMED(
demo::employee, adapted_employee, demo::employee, adapted_employee,
(BOOST_FUSION_ADAPT_AUTO, name), (auto, name),
(BOOST_FUSION_ADAPT_AUTO, age)) (auto, age))
[endsect] [endsect]
@ -481,7 +481,7 @@ The sequence of `([member_typeN,] member_nameN, key_typeN)` tuples
declares the type, name and key type of each of the struct members declares the type, name and key type of each of the struct members
that are part of the sequence. that are part of the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macro should be used at global scope, and `struct_name` should be the fully The macro should be used at global scope, and `struct_name` should be the fully
@ -519,8 +519,8 @@ namespace qualified name of the struct to be adapted.
// Without BOOST_PP_VARIADICS support : // Without BOOST_PP_VARIADICS support :
BOOST_FUSION_ADAPT_ASSOC_STRUCT( BOOST_FUSION_ADAPT_ASSOC_STRUCT(
demo::employee, demo::employee,
(BOOST_FUSION_ADAPT_AUTO, name, keys::name), (auto, name, keys::name),
(BOOST_FUSION_ADAPT_AUTO, age, keys::name)) (auto, age, keys::name))
[endsect] [endsect]
@ -554,7 +554,7 @@ The sequence of `([member_typeN,] member_nameN, key_typeN)`
tuples declares the type, name and key type of each of the struct members tuples declares the type, name and key type of each of the struct members
that are part of the sequence. that are part of the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macro should be used at global scope, and `struct_name` should be the fully The macro should be used at global scope, and `struct_name` should be the fully
@ -641,7 +641,7 @@ The sequence of `(member_typeN, member_nameN, key_typeN)`
triples declares the type, name and key type of each of the struct members triples declares the type, name and key type of each of the struct members
that are part of the sequence. that are part of the sequence.
When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is When member_typeN is omitted or set to auto, the type is
infered with Boost.TypeOf. infered with Boost.TypeOf.
The macros should be used at global scope, and `struct_name` should be the fully The macros should be used at global scope, and `struct_name` should be the fully
@ -678,8 +678,8 @@ namespace qualified name of the struct to be converted.
// Without BOOST_PP_VARIADICS support : // Without BOOST_PP_VARIADICS support :
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
demo::employee, adapted_employee, demo::employee, adapted_employee,
(BOOST_FUSION_ADAPT_AUTO, name, keys::name) (auto, name, keys::name)
(BOOST_FUSION_ADAPT_AUTO, age, keys::age)) (auto, age, keys::age))
[endsect] [endsect]
@ -713,7 +713,7 @@ instance of `type_name`.
[^attribute_type['N]] and [^attribute_const_type['N]] may specify the types [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types
that [^get_expr['N]] denotes to, when omitted the type is deduced from that [^get_expr['N]] denotes to, when omitted the type is deduced from
[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for
variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. variadic macros auto can be used to avoid repeating the type.
[^set_expr['N]] is the expression that is invoked to set the ['N]th element [^set_expr['N]] is the expression that is invoked to set the ['N]th element
of an instance of `type_name`. This expression may access variables named of an instance of `type_name`. This expression may access variables named
`obj` of type `type_name&`, which represent the corresponding instance of `obj` of type `type_name&`, which represent the corresponding instance of
@ -823,7 +823,7 @@ instance of `type_name`.
[^attribute_type['N]] and [^attribute_const_type['N]] may specify the types [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types
that [^get_expr['N]] denotes to, when omitted the type is deduced from that [^get_expr['N]] denotes to, when omitted the type is deduced from
[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for
variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. variadic macros auto can be used to avoid repeating the type.
[^set_expr['N]] is the expression that is invoked to set the ['N]th element [^set_expr['N]] is the expression that is invoked to set the ['N]th element
of an instance of `type_name`. This expression may access variables named of an instance of `type_name`. This expression may access variables named
`obj` of type `type_name&`, which represent the corresponding instance of `obj` of type `type_name&`, which represent the corresponding instance of
@ -928,7 +928,7 @@ instance of `type_name`.
[^attribute_type['N]] and [^attribute_const_type['N]] may specify the types [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types
that [^get_expr['N]] denotes to, when omitted the type is deduced from that [^get_expr['N]] denotes to, when omitted the type is deduced from
[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for
variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. variadic macros auto can be used to avoid repeating the type.
[^set_expr['N]] is the expression that is invoked to set the ['N]th element [^set_expr['N]] is the expression that is invoked to set the ['N]th element
of an instance of `type_name`. This expression may access variables named of an instance of `type_name`. This expression may access variables named
`obj` of type `type_name&`, which represent the corresponding instance of `obj` of type `type_name&`, which represent the corresponding instance of
@ -1044,7 +1044,7 @@ instance of `type_name`.
[^attribute_type['N]] and [^attribute_const_type['N]] may specify the types [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types
that [^get_expr['N]] denotes to, when omitted the type is deduced from that [^get_expr['N]] denotes to, when omitted the type is deduced from
[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for [get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for
variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. variadic macros auto can be used to avoid repeating the type.
[^set_expr['N]] is the expression that is invoked to set the ['N]th element [^set_expr['N]] is the expression that is invoked to set the ['N]th element
of an instance of `type_name`. This expression may access variables named of an instance of `type_name`. This expression may access variables named
`obj` of type `type_name&`, which represent the corresponding instance of `obj` of type `type_name&`, which represent the corresponding instance of

View File

@ -15,7 +15,6 @@
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/comparison/less.hpp> #include <boost/preprocessor/comparison/less.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
@ -45,13 +44,11 @@
TEMPLATE_PARAMS_SEQ, \ TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \ NAME_SEQ, \
I, \ I, \
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \ BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4) \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4)) \
, 1, 0))
#define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \ BOOST_FUSION_ADAPT_STRUCT_BASE( \

View File

@ -14,7 +14,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/control/if.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_const.hpp>
@ -46,13 +46,11 @@
TEMPLATE_PARAMS_SEQ, \ TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \ NAME_SEQ, \
I, \ I, \
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \ BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5)) \
, 1, 0)) \
\ \
template< \ template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \

View File

@ -15,8 +15,10 @@
#include <boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp> #include <boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp>
#include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/seq/seq.hpp> #include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/elem.hpp> #include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
@ -36,18 +38,18 @@
boost::remove_const<boost::remove_reference<lvalue>::type>::type boost::remove_const<boost::remove_reference<lvalue>::type>::type
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ #define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE) BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE)
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ #define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE)
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ # define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \ TEMPLATE_PARAMS_SEQ) \
@ -55,52 +57,57 @@
struct deduced_attr_type { \ struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef \ typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \
typename) \
BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \
}; };
#else #else
# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ # define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
struct deduced_attr_type { \ struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \
}; };
#endif #endif
#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
BOOST_FUSION_DEDUCED_ATTR_TYPE( \ BOOST_FUSION_DEDUCED_ATTR_TYPE( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
typedef \ typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \
typename) \
boost::remove_const< \ boost::remove_const< \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \
typename) \
deduced_attr_type::type \ deduced_attr_type::type \
>::type type; \ >::type type; \
\ \
typedef \ typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \
typename) \
boost::add_const< \ boost::add_const< \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ BOOST_PP_EXPR_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), \
typename) \
deduced_attr_type::type \ deduced_attr_type::type \
>::type const_type; >::type const_type;
#define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) type; \
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 1, ATTRIBUTE) const_type;
#define BOOST_FUSION_ADAPT_ADT_C_BASE( \ #define BOOST_FUSION_ADAPT_ADT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \
ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
\ \
template< \ template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
@ -116,7 +123,7 @@
BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \ BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \
NAME_SEQ, \ NAME_SEQ, \
ATTRIBUTE, \ ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
PREFIX, \ PREFIX, \
TEMPLATE_PARAMS_SEQ) \ TEMPLATE_PARAMS_SEQ) \
\ \
@ -128,7 +135,7 @@
Val const& val) \ Val const& val) \
{ \ { \
PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
@ -137,7 +144,7 @@
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
{ \ { \
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \ } \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
@ -146,7 +153,7 @@
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
{ \ { \
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \ } \
}; \ }; \
\ \
@ -160,7 +167,7 @@
> \ > \
{ \ { \
typedef \ typedef \
BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename) \
access::adt_attribute_access< \ access::adt_attribute_access< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \ , I \
@ -201,7 +208,7 @@
> \ > \
{ \ { \
typedef \ typedef \
BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename) \
access::adt_attribute_access< \ access::adt_attribute_access< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \ , I \
@ -252,7 +259,8 @@
, I \ , I \
> \ > \
{ \ { \
typedef BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ typedef BOOST_PP_EXPR_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \
typename) \
adt_attribute_proxy< \ adt_attribute_proxy< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \ , I \

View File

@ -10,12 +10,15 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp> #include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
#include <boost/preprocessor/control/if.hpp> #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
#include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/variadic/size.hpp> #include <boost/preprocessor/variadic/size.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#if BOOST_PP_VARIADICS #if BOOST_PP_VARIADICS
@ -41,7 +44,7 @@
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \
((3, (C,D,E))), \ ((3, (C,D,E))), \
((5, (A,B,C,D,E))) \ ((5, (A,B,C,D,E))) \
) )
@ -55,7 +58,7 @@
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ #define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM( \ BOOST_PP_TUPLE_ELEM( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_SUB(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ BOOST_PP_DEC(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE)) BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE))
#endif #endif

View File

@ -9,23 +9,21 @@
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP #define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp> #include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp> #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/tuple/size.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/variadic/to_tuple.hpp>
#include <boost/preprocessor/variadic/elem.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/push_front.hpp>
#include <boost/preprocessor/seq/rest_n.hpp>
#include <boost/preprocessor/tuple/reverse.hpp> #include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/variadic/size.hpp>
#include <boost/preprocessor/variadic/elem.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/rest_n.hpp>
#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ #define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \
@ -47,11 +45,15 @@
# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END # define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
// MSVC don't compile when using BOOST_PP_BITOR instead of BOOST_PP_OR.
# define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ # define BOOST_FUSION_ADAPT_ADT_FILLER(...) \
BOOST_PP_IF( \ BOOST_PP_IIF( \
BOOST_PP_OR( \ BOOST_PP_OR( \
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ BOOST_MPL_PP_TOKEN_EQUAL(auto, \
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \ BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
BOOST_MPL_PP_TOKEN_EQUAL(auto, \
BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \
\
BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \ BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \
BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \ BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \
BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \ BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \
@ -63,7 +65,7 @@
# define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \ # define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \
BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \ BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \
BOOST_PP_SUB(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), \ BOOST_PP_DEC(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)), \
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)))
#else // BOOST_PP_VARIADICS #else // BOOST_PP_VARIADICS
@ -80,7 +82,7 @@
# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END # define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \ # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, A), \
((2, (C,D))), \ ((2, (C,D))), \
((4, (A,B,C,D))) \ ((4, (A,B,C,D))) \
) )

View File

@ -13,7 +13,8 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
@ -44,11 +45,11 @@
NAME_SEQ, \ NAME_SEQ, \
IS_VIEW, \ IS_VIEW, \
I, \ I, \
PREFIX, \ BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_IF(BOOST_PP_LESS( \ BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3)) \
\ \
template< \ template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \

View File

@ -12,13 +12,6 @@
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp> #include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp> #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
\ \
@ -27,9 +20,7 @@
\ \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
BOOST_PP_CAT( \ ATTRIBUTES)
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \
_END))
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \

View File

@ -14,9 +14,8 @@
#include <boost/preprocessor/config/config.hpp> #include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/comparison/less.hpp> #include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/seq/seq.hpp> #include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp> #include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/add_reference.hpp>
@ -45,13 +44,11 @@
NAME_SEQ, \ NAME_SEQ, \
IS_VIEW, \ IS_VIEW, \
I, \ I, \
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \ BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2) \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2))
, 1, 0))

View File

@ -13,7 +13,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp> #include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp> #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/config/config.hpp>
#ifdef BOOST_PP_VARIADICS #ifdef BOOST_PP_VARIADICS

View File

@ -11,6 +11,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp> #include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/detail/define_struct.hpp> #include <boost/fusion/adapted/struct/detail/define_struct.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ #define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1 ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1

View File

@ -11,6 +11,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp> #include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/detail/define_struct.hpp> #include <boost/fusion/adapted/struct/detail/define_struct.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_FUSION_DEFINE_TPL_STRUCT( \ #define BOOST_FUSION_DEFINE_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \

View File

@ -8,8 +8,7 @@
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP
#include <boost/preprocessor/empty.hpp> #define BOOST_FUSION_ADAPT_AUTO auto
#define BOOST_MPL_PP_TOKEN_EQUAL_auto(x) x
#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY()
#endif #endif

View File

@ -29,6 +29,7 @@
#include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp> #include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/comparison/less.hpp> #include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
#include <boost/mpl/tag.hpp> #include <boost/mpl/tag.hpp>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/eval_if.hpp>
@ -64,7 +65,7 @@
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ # define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \ TEMPLATE_PARAMS_SEQ) \
@ -73,7 +74,7 @@
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef \ typedef \
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
0, ATTRIBUTE)) \ 0, ATTRIBUTE)) \
type; \ type; \
}; \ }; \
@ -84,12 +85,12 @@
#else #else
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ # define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\ \
struct deduced_attr_type { \ struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef BOOST_TYPEOF( \ typedef BOOST_TYPEOF( \
PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \ PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE)) \
type; \ type; \
}; \ }; \
\ \
@ -100,9 +101,9 @@
#endif #endif
#define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
typedef \ typedef \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) attribute_type;
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
@ -159,7 +160,7 @@
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \
I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \ I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, \
DEDUCE_TYPE) \ DEDUCE_TYPE) \
\ \
template< \ template< \
@ -174,7 +175,7 @@
BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \ BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \
NAME_SEQ, \ NAME_SEQ, \
ATTRIBUTE, \ ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
PREFIX, \ PREFIX, \
TEMPLATE_PARAMS_SEQ) \ TEMPLATE_PARAMS_SEQ) \
\ \
@ -201,8 +202,8 @@
call(Seq& seq) \ call(Seq& seq) \
{ \ { \
return seq.PREFIX() \ return seq.PREFIX() \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \ BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE); \
} \ } \
}; \ }; \
}; \ }; \
@ -222,9 +223,8 @@
call() \ call() \
{ \ { \
return BOOST_PP_STRINGIZE( \ return BOOST_PP_STRINGIZE( \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \ BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE)); \
ATTRIBUTE)); \
} \ } \
}; };
@ -274,7 +274,7 @@ namespace boost
struct struct_is_view< \ struct struct_is_view< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
> \ > \
: mpl::BOOST_PP_IF(IS_VIEW,true_,false_) \ : mpl::BOOST_PP_IIF(IS_VIEW,true_,false_) \
{}; \ {}; \
} \ } \
} \ } \

View File

@ -10,13 +10,16 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp> #include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
#include <boost/preprocessor/control/if.hpp> #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/variadic/size.hpp> #include <boost/preprocessor/variadic/size.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/variadic/elem.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#if BOOST_PP_VARIADICS #if BOOST_PP_VARIADICS
@ -29,7 +32,14 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \
((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_PP_IIF( \
BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
((2, \
(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__), \
BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__)))), \
((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \
(__VA_ARGS__))) \
)
#else // BOOST_PP_VARIADICS #else // BOOST_PP_VARIADICS
@ -43,7 +53,7 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, X), \
((2, (Y,Z))), \ ((2, (Y,Z))), \
((3, (X,Y,Z))) \ ((3, (X,Y,Z))) \
) )
@ -57,7 +67,7 @@
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM( \ BOOST_PP_TUPLE_ELEM( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ BOOST_PP_DEC(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE)), \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE))
#endif #endif

View File

@ -9,15 +9,21 @@
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp> #include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/mpl/aux_/preprocessor/token_equal.hpp>
#include <boost/preprocessor/tuple/size.hpp>
#include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/control/expr_iif.hpp>
#include <boost/preprocessor/logical/compl.hpp>
#include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp> #include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/push_front.hpp> #include <boost/preprocessor/seq/push_front.hpp>
#include <boost/preprocessor/facilities/expand.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \
@ -32,7 +38,7 @@
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
#define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \ #define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ BOOST_PP_IIF(BOOST_MPL_PP_TOKEN_EQUAL(auto, BOOST_PP_EXPAND(X)), \
((1, (Y))), \ ((1, (Y))), \
((2, (X,Y))) \ ((2, (X,Y))) \
) )
@ -47,12 +53,10 @@
#if BOOST_PP_VARIADICS #if BOOST_PP_VARIADICS
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \ # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \
BOOST_PP_IF(BOOST_FUSION_PP_IS_SEQ(elem), \ BOOST_PP_IIF(BOOST_FUSION_PP_IS_SEQ(elem), \
BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(elem), \ BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(BOOST_PP_IS_EMPTY(elem)), \
BOOST_PP_EMPTY(), \ BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto, elem)))
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO,elem))\
)
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \ # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \
BOOST_PP_SEQ_PUSH_FRONT( \ BOOST_PP_SEQ_PUSH_FRONT( \

View File

@ -8,6 +8,8 @@
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP
#include <boost/preprocessor/seq/seq.hpp>
#define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \ #define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)

View File

@ -16,13 +16,11 @@
#include <boost/fusion/iterator/advance.hpp> #include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp> #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
#include <boost/fusion/adapted/struct/detail/namespace.hpp> #include <boost/fusion/adapted/struct/detail/namespace.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/if.hpp> #include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/expr_if.hpp> #include <boost/preprocessor/expr_if.hpp>
#include <boost/preprocessor/dec.hpp> #include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/logical/not.hpp> #include <boost/preprocessor/logical/not.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/seq/seq.hpp> #include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp> #include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp> #include <boost/preprocessor/seq/for_each_i.hpp>
@ -42,14 +40,14 @@
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END #define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \ #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\ \
BOOST_PP_COMMA_IF(I) \ BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)) other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE))
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \ #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
\ \
BOOST_PP_EXPR_IF( \ BOOST_PP_EXPR_IF( \
I_, \ I_, \
@ -62,11 +60,11 @@
boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \ boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \
) \ ) \
\ \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \
boost::fusion::deref(BOOST_PP_CAT(i,I_)); boost::fusion::deref(BOOST_PP_CAT(i,I_));
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \ #define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
template<typename Seq> \ template<typename Seq> \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
@ -81,51 +79,51 @@
BOOST_PP_SEQ_FOR_EACH_I_R( \ BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
\ \
return *this; \ return *this; \
} }
#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPEL_SIZE, ATTRIBUTE) \ #define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPLE_SIZE, ATTRIBUTE) \
\ \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE); BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \ #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\ \
BOOST_PP_COMMA_IF(I) \ BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
boost::fusion::deref(boost::fusion::advance_c<I>(boost::fusion::begin( \ boost::fusion::deref(boost::fusion::advance_c<I>(boost::fusion::begin( \
seq)))) seq))))
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \ #define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
, typename boost::disable_if< \ , typename boost::disable_if< \
boost::is_convertible< \ boost::is_convertible< \
Seq const& \ Seq const& \
, BOOST_PP_TUPLE_ELEM( \ , BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
0, \ 0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
> \ > \
>::type* =0 >::type* =0
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \ #define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\ \
BOOST_PP_COMMA_IF(I) \ BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)() BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)()
#define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ #define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_PP_SEQ_FOR_EACH_R( \ BOOST_PP_SEQ_FOR_EACH_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \ BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
@ -133,7 +131,7 @@
: BOOST_PP_SEQ_FOR_EACH_I_R( \ : BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
{} \ {} \
\ \
@ -142,7 +140,7 @@
: BOOST_PP_SEQ_FOR_EACH_I_R( \ : BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
{} \ {} \
\ \
@ -153,53 +151,53 @@
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_PP_TUPLE_EAT(2), \ BOOST_PP_TUPLE_EAT(2), \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \ BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
) \ ) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \ : BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
{} \ {} \
\ \
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
explicit \ explicit \
NAME(boost::call_traits< \ NAME(boost::call_traits< \
BOOST_PP_TUPLE_ELEM( \ BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ ATTRIBUTE_TUPLE_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
>::param_type arg) \ >::param_type arg) \
: BOOST_PP_TUPLE_ELEM( \ : BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
{} {}
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
explicit \ explicit \
NAME(typename boost::call_traits< \ NAME(typename boost::call_traits< \
typename boost::fusion::detail::get_first_arg< \ typename boost::fusion::detail::get_first_arg< \
BOOST_PP_TUPLE_ELEM( \ BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
0, \ 0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
, BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ , BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
>::type \ >::type \
>::param_type arg) \ >::param_type arg) \
: BOOST_PP_TUPLE_ELEM( \ : BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ ATTRIBUTE_TUPLE_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
{} {}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\ \
BOOST_PP_COMMA_IF(I) \ BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I)) BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I))
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \
\ \
@ -215,14 +213,14 @@
>::param_type BOOST_PP_CAT(_,I) >::param_type BOOST_PP_CAT(_,I)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
( \ ( \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \ BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
), \ ), \
@ -230,61 +228,61 @@
: BOOST_PP_SEQ_FOR_EACH_I_R( \ : BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
{} {}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\ \
BOOST_PP_COMMA_IF(I) \ BOOST_PP_COMMA_IF(I) \
boost::call_traits< \ boost::call_traits< \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
>::param_type BOOST_PP_CAT(_,I) >::param_type BOOST_PP_CAT(_,I)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ)) \ ATTRIBUTES_SEQ)) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \ : BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \ 1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
{} {}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR( \ #define BOOST_FUSION_DEFINE_STRUCT_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_1)( \ BOOST_FUSION_DEFINE_STRUCT_CTOR_1)( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1)( \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1)( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \ NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_DEFINE_STRUCT_CTOR( \ BOOST_FUSION_DEFINE_STRUCT_CTOR( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
template<typename Seq> \ template<typename Seq> \
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
@ -300,7 +298,7 @@
} }
#define BOOST_FUSION_DEFINE_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_STRUCT_IMPL( \
NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\ \
@ -311,35 +309,35 @@
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL, \ BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL, \
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL)( \ BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL)( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
}; \ }; \
\ \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
#define BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \ NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
TEMPLATE_PARAMS_SEQ, \ TEMPLATE_PARAMS_SEQ, \
NAME, \ NAME, \
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \ BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \
ATTRIBUTE_TUPEL_SIZE) ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \ BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \ #define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, \ TEMPLATE_PARAMS_SEQ, \
NAMESPACE_SEQ, \ NAMESPACE_SEQ, \
NAME, \ NAME, \
ATTRIBUTES_SEQ, \ ATTRIBUTES_SEQ, \
ATTRIBUTE_TUPEL_SIZE) \ ATTRIBUTE_TUPLE_SIZE) \
\ \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\ \
@ -354,7 +352,7 @@
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL, \ BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL, \
BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL)( \ BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL)( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)\ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)\
}; \ }; \
\ \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)

View File

@ -22,7 +22,7 @@
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/preprocessor/comma_if.hpp> #include <boost/preprocessor/comma_if.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp> #include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/repeat.hpp> #include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp> #include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/size.hpp> #include <boost/preprocessor/seq/size.hpp>
@ -62,7 +62,6 @@
~, \ ~, \
ATTRIBUTES_SEQ) \ ATTRIBUTES_SEQ) \
#define BOOST_FUSION_IGNORE_1(ARG1)
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2) #define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \ #define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
@ -425,17 +424,10 @@
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \ NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \
\ \
/* Note: second BOOST_PP_IF is necessary to avoid MSVC warning when */ \
/* calling BOOST_FUSION_IGNORE_1 with no arguments. */ \
NAME() \ NAME() \
BOOST_PP_IF( \ BOOST_PP_IF(ATTRIBUTES_SEQ_SIZE, \
ATTRIBUTES_SEQ_SIZE, \
BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \ BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \
BOOST_FUSION_IGNORE_1) \ BOOST_PP_EMPTY)(ATTRIBUTES_SEQ) \
(BOOST_PP_IF( \
ATTRIBUTES_SEQ_SIZE, \
ATTRIBUTES_SEQ, \
0)) \
{ \ { \
} \ } \
\ \

View File

@ -13,8 +13,6 @@
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/punctuation/paren.hpp> #include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/config/config.hpp> #include <boost/preprocessor/config/config.hpp>

View File

@ -103,7 +103,8 @@ namespace ns
BOOST_FUSION_ADAPT_ADT( BOOST_FUSION_ADAPT_ADT(
ns::point, ns::point,
(int, int, obj.get_x(), obj.set_x(val)) (int, int, obj.get_x(), obj.set_x(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) // Mixing auto & BOOST_FUSION_ADAPT_AUTO to test backward compatibility
(auto, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val))
(obj.get_z(), obj.set_z(val)) (obj.get_z(), obj.set_z(val))
) )
@ -128,23 +129,23 @@ namespace ns
BOOST_FUSION_ADAPT_ADT( BOOST_FUSION_ADAPT_ADT(
ns::point, ns::point,
(int, int, obj.get_x(), obj.set_x(val)) (int, int, obj.get_x(), obj.set_x(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) (auto, auto, obj.get_y(), obj.set_y(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) (auto, auto, obj.get_z(), obj.set_z(val))
) )
# if !BOOST_WORKAROUND(__GNUC__,<4) # if !BOOST_WORKAROUND(__GNUC__,<4)
BOOST_FUSION_ADAPT_ADT( BOOST_FUSION_ADAPT_ADT(
ns::point_with_private_members, ns::point_with_private_members,
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val)) (auto, auto, obj.get_x(), obj.set_x(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) (auto, auto, obj.get_y(), obj.set_y(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) (auto, auto, obj.get_z(), obj.set_z(val))
) )
# endif # endif
BOOST_FUSION_ADAPT_ADT( BOOST_FUSION_ADAPT_ADT(
ns::name, ns::name,
(const std::string&, const std::string&, obj.get_last(), obj.set_last(val)) (const std::string&, const std::string&, obj.get_last(), obj.set_last(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_first(), obj.set_first(val)) (BOOST_FUSION_ADAPT_AUTO, auto, obj.get_first(), obj.set_first(val))
) )
#endif #endif

View File

@ -72,7 +72,7 @@ BOOST_FUSION_ADAPT_ADT_NAMED(
ns::point, point, ns::point, point,
(int, int, obj.get_x(), obj.set_x(val)) (int, int, obj.get_x(), obj.set_x(val))
(int, int, obj.get_y(), obj.set_y(val)) (int, int, obj.get_y(), obj.set_y(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) (auto, auto, obj.get_z(), obj.set_z(val))
) )
#endif // BOOST_PP_VARIADICS #endif // BOOST_PP_VARIADICS

View File

@ -65,7 +65,7 @@ BOOST_FUSION_ADAPT_ASSOC_ADT(
ns::point, ns::point,
(int, int, obj.get_x(), obj.set_x(val), ns::x_member) (int, int, obj.get_x(), obj.set_x(val), ns::x_member)
(int, int, obj.get_y(), obj.set_y(val), ns::y_member) (int, int, obj.get_y(), obj.set_y(val), ns::y_member)
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) (auto, auto, obj.get_z(), obj.set_z(val), ns::z_member)
) )
#endif #endif

View File

@ -45,12 +45,26 @@ namespace ns
}; };
} }
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( #if BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
ns::point, ns::point,
point, point,
(int, int, obj.get_x(), obj.set_x(val), ns::x_member) (obj.get_x(), obj.set_x(val), ns::x_member)
(int, int, obj.get_y(), obj.set_y(val), ns::y_member) (int, int, obj.get_y(), obj.set_y(val), ns::y_member)
) )
#else // BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
ns::point,
point,
(auto, auto, obj.get_x(), obj.set_x(val), ns::x_member)
(int, int, obj.get_y(), obj.set_y(val), ns::y_member)
)
#endif
class empty_adt{}; class empty_adt{};
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,) BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,)

View File

@ -57,15 +57,15 @@ namespace ns
BOOST_FUSION_ADAPT_ASSOC_STRUCT( BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point, ns::point,
(x, ns::x_member) (x, ns::x_member)
(y, ns::y_member) (auto, y, ns::y_member)
(int, z, ns::z_member) (int, z, ns::z_member)
) )
#else // BOOST_PP_VARIADICS #else // BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT( BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point, ns::point,
(BOOST_FUSION_ADAPT_AUTO, x, ns::x_member) (auto, x, ns::x_member)
(BOOST_FUSION_ADAPT_AUTO, y, ns::y_member) (auto, y, ns::y_member)
(int, z, ns::z_member) (int, z, ns::z_member)
) )

View File

@ -31,12 +31,26 @@ namespace ns
}; };
} }
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
#if BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
ns::point,
point,
(x, ns::x_member)
(auto, y, ns::y_member)
)
#else // BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
ns::point, ns::point,
point, point,
(int, x, ns::x_member) (int, x, ns::x_member)
(int, y, ns::y_member) (auto, y, ns::y_member)
) )
#endif
struct empty_struct {}; struct empty_struct {};
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,); BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,);

View File

@ -66,7 +66,7 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
(ns::point)(X)(Y)(Z), (ns::point)(X)(Y)(Z),
(X, X, obj.get_x(), obj.set_x(val), ns::x_member) (X, X, obj.get_x(), obj.set_x(val), ns::x_member)
(Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member)
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) (auto, auto, obj.get_z(), obj.set_z(val), ns::z_member)
) )
#endif #endif

View File

@ -55,7 +55,7 @@ namespace ns
(X)(Y)(Z), (X)(Y)(Z),
(ns::point)(X)(Y)(Z), (ns::point)(X)(Y)(Z),
(int, x, ns::x_member) (int, x, ns::x_member)
(Y, y, ns::y_member) (auto, y, ns::y_member)
(z, ns::z_member) (z, ns::z_member)
) )
@ -65,7 +65,7 @@ namespace ns
(ns::point)(X)(Y)(Z), (ns::point)(X)(Y)(Z),
(int, x, ns::x_member) (int, x, ns::x_member)
(Y, y, ns::y_member) (Y, y, ns::y_member)
(BOOST_FUSION_ADAPT_AUTO, z, ns::z_member) (auto, z, ns::z_member)
) )
#endif #endif

View File

@ -32,13 +32,17 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
namespace namespaced_type {
typedef int integer;
}
namespace ns namespace ns
{ {
struct point struct point
{ {
int x; int x;
int y; int y;
int z; namespaced_type::integer z;
}; };
#if !BOOST_WORKAROUND(__GNUC__,<4) #if !BOOST_WORKAROUND(__GNUC__,<4)
@ -104,7 +108,7 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(
ns::bar, ns::bar,
foo_.x, // test that adapted members can actually be expressions foo_.x, // test that adapted members can actually be expressions
y (auto , y)
) )
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(
@ -119,8 +123,8 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(
ns::point, ns::point,
(int, x) (int, x)
(int, y) (auto, y)
(BOOST_FUSION_ADAPT_AUTO, z) (namespaced_type::integer, z)
) )
# if !BOOST_WORKAROUND(__GNUC__,<4) # if !BOOST_WORKAROUND(__GNUC__,<4)
@ -128,17 +132,18 @@ namespace ns
ns::point_with_private_attributes, ns::point_with_private_attributes,
(int, x) (int, x)
(int, y) (int, y)
(BOOST_FUSION_ADAPT_AUTO, z) (auto, z)
) )
# endif # endif
struct s { int m; }; struct s { int m; };
BOOST_FUSION_ADAPT_STRUCT(s, (BOOST_FUSION_ADAPT_AUTO, m)) BOOST_FUSION_ADAPT_STRUCT(s, (auto, m))
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(
ns::bar, ns::bar,
(BOOST_FUSION_ADAPT_AUTO, foo_.x) // test that adapted members can actually be expressions (auto, foo_.x) // test that adapted members can actually be expressions
(BOOST_FUSION_ADAPT_AUTO, y) (BOOST_FUSION_ADAPT_AUTO, y) // Mixing auto & BOOST_FUSION_ADAPT_AUTO
// to test backward compatibility
) )
BOOST_FUSION_ADAPT_STRUCT( BOOST_FUSION_ADAPT_STRUCT(

View File

@ -61,13 +61,13 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT_NAMED( BOOST_FUSION_ADAPT_STRUCT_NAMED(
ns::point, point, ns::point, point,
(int, x) (int, x)
(int, y) (BOOST_FUSION_ADAPT_AUTO, y)
(BOOST_FUSION_ADAPT_AUTO, z) (auto, z)
) )
// this creates a fusion view: ns1::s1 // this creates a fusion view: ns1::s1
struct s { int m; }; struct s { int m; };
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (BOOST_FUSION_ADAPT_AUTO, m)) BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (auto, m))
#endif #endif

View File

@ -75,7 +75,7 @@ namespace ns
(ns::point)(X)(Y), (ns::point)(X)(Y),
(X, X, obj.get_x(), obj.set_x(val)) (X, X, obj.get_x(), obj.set_x(val))
(Y, Y, obj.get_y(), obj.set_y(val)) (Y, Y, obj.get_y(), obj.set_y(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) (auto, auto, obj.get_z(), obj.set_z(val))
) )
#endif #endif

View File

@ -45,7 +45,7 @@ namespace ns
(X)(Y), (X)(Y),
(ns::point)(X)(Y), (ns::point)(X)(Y),
x, x,
(BOOST_FUSION_ADAPT_AUTO, y) (auto, y)
(int, z) (int, z)
) )
@ -60,12 +60,12 @@ namespace ns
(ns::point)(X)(Y), (ns::point)(X)(Y),
(X, x) (X, x)
(Y, y) (Y, y)
(BOOST_FUSION_ADAPT_AUTO, z) (auto, z)
) )
template<typename M> template<typename M>
struct s { M m; }; struct s { M m; };
BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (BOOST_FUSION_ADAPT_AUTO, m)) BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (auto, m))
#endif #endif