Compare commits

...

89 Commits

Author SHA1 Message Date
6109fa0e5a Add tests for nested map and set. 2017-06-20 00:37:03 +09:00
bf4ddf8611 Add tests for issue 11932.
https://svn.boost.org/trac/boost/ticket/11932
2017-06-20 00:31:36 +09:00
36eac2e77c Added missing include file. 2017-06-18 23:12:50 +09:00
bb782de1ff Merge pull request #146 from Flast/update-workarounds
Update workarounds for msvc 14.1
2017-05-01 13:12:56 +09:00
451e21adb3 Update workarounds for msvc 14.1 2017-04-30 23:26:24 +09:00
e0ceefafb6 Merge pull request #145 from boostorg/test-config
Refresh Jamfile
2017-04-30 22:41:34 +09:00
2952fd254f Use build time config to filter tests. 2017-04-27 22:23:39 +09:00
1ec001888d Reformatting. 2017-02-02 22:08:16 +09:00
98b81ee102 Remove use of deprecated binder. (#144) 2016-11-20 16:58:04 +09:00
f1a619428a Remove unintended file. 2016-11-20 16:41:23 +09:00
fcdcfcd2c5 Merge pull request #143 from boostorg/bugfix/returing-tmp-variable
Fix returing temporary variable warning on MSVC.
2016-11-01 02:44:58 +09:00
6f43cd7f66 Correct testcase condition. 2016-11-01 02:28:45 +09:00
c630611626 Fix returing temporary variable warning on MSVC. 2016-11-01 01:54:10 +09:00
0d8243b36d Merge pull request #142 from Flast/std_array
Adaptor for std::array.
2016-10-31 01:40:57 +09:00
ea9a176312 Include <array> instead of declare std::array.
Some implementations declare it as std::tr1::array and conflict.
2016-10-31 01:13:36 +09:00
1747703b1a Merge pull request #140 from Flast/bugfix/define_struct
Workarounds for older compilers.
2016-10-29 22:28:34 +09:00
c158886591 Workaround for MSVC 12 variadics bug. 2016-10-29 21:29:26 +09:00
5135b5109b Likewise. 2016-10-29 20:57:06 +09:00
490baac6e2 Added workaround for older gcc. 2016-10-29 15:34:49 +09:00
6bd644d43d Don't use iterator for copy/move assign op. 2016-10-29 14:40:47 +09:00
64af83d999 Merge pull request #138 from Flast/movable-define_struct
DEFINE_STRUCT now allows move construct/assign.
2016-10-24 00:00:06 +09:00
e74ccb1cf5 DEFINE_STRUCT now allows move construct/assign. 2016-10-19 01:33:43 +09:00
7b13053c7e Merge pull request #135 from vtnerd/bugfix/vector_conversion_constructor
Make C++11 fusion::vector more consistent with C++03 fusion::vector
2016-10-14 13:51:52 +09:00
ef2dc2aaae Merge pull request #137 from boostorg/empty_struct
Allow to define empty struct.
2016-10-14 11:44:55 +09:00
ef1ca12e81 Added tests for adapted empty struct. 2016-10-14 01:47:02 +09:00
a2b8a8f254 Don't define user-provided special functions.
To allow to define empty struct.
2016-10-13 00:18:14 +09:00
16a069be14 Fix test for non C++11/14. 2016-10-11 08:22:35 +09:00
61fab16418 Merge branch 'mloskot/boost_fusion_std_array' into develop 2016-10-10 18:46:29 +09:00
928ced256a Adjust directory structure. 2016-10-09 22:14:42 +09:00
599b8d4aef Add, and update, documentation build targets. 2016-10-07 23:07:34 -05:00
1a2a8d67aa Merge pull request #136 from Kojoley/fix-extra-semicolon
Fixed extra semicolon
2016-09-02 00:32:41 +08:00
d5740f8310 Fixed extra semicolon 2016-09-01 17:57:15 +03:00
5906d9c316 Make C++11 fusion::vector more consistent with C++03 fusion::vector
- Construct from elements is enabled iff each argument is_convertible to
    corresponding element.
  - Construct from sequence is enabled iff the single argument is a fusion
    sequence.
  - C++11 vector and tuple also disable construct from sequence that are
    shorter than the destination. C++03 gives incorrect is_convertible
    responses in this situation and fails to compile if that constructor is
    used; C++11 can have instantation errors in
    and_<is_convertible<U, T>...> without the additional check.
  - C++11 tuple and vector support truncation conversion and assignment like
    all other sequences.
2016-08-26 12:45:11 -04:00
45d9b49ee5 Merge pull request #134 from vtnerd/bugfix/tuple_element_construction
Add DISABLE_VARIADIC_VECTOR and SFINAE for c++11 tuple element construction
2016-07-31 15:58:17 +09:00
55150a7fa6 Add DISABLE_VARIADIC_VECTOR and SFINAE for c++11 tuple element construction 2016-07-26 14:53:26 -04:00
27321dd18e Merge pull request #132 from vtnerd/bugfix/nested_sequence_cpp11
Added to nested tests, and fixed C++11 vector copy-from-sequence
2016-06-01 06:47:21 +08:00
79d8e9d11c Added to nested tests, and fixed C++11 vector copy-from-sequence 2016-05-31 16:52:57 -04:00
7e4ab4f804 Merge pull request #130 from Flast/bugfix/gcc34
Added workaround for GCC 3.4 due to ambiguous.
2016-03-16 21:36:54 +08:00
3189580857 Added workaround for GCC 3.4 due to ambiguous.
NOTE: GCC 3.3 and earlier are not supported officially by Boost community.
2016-03-16 20:25:59 +09:00
71dcb3e02c Merge pull request #129 from Flast/testfix/gcc44-std_tuple
Tweak std::tuple test for GCC 4.4
2016-03-11 13:24:42 +08:00
82f24e0f73 Tweak std::tuple test for GCC 4.4
due to https://gcc.gnu.org/PR41530 .
2016-03-11 01:01:12 +09:00
f29e1e8209 Merge pull request #128 from Flast/patch-1
Correct workaround condition.
2016-03-09 10:00:31 +08:00
12b25c2c99 Correct workaround condition. 2016-03-09 10:19:22 +09:00
bc6eaf7ab0 Merge pull request #127 from Flast/workaround/for-older-gcc
Workaround for ICE on GCC 4.0/4.1.
2016-03-08 16:26:56 +08:00
275236f86e Workaround for ICE on GCC 4.0 and 4.1. 2016-03-08 15:36:21 +09:00
a8b70d6679 Workaround for ICE on GCC 4.0.0. 2016-03-08 14:43:32 +09:00
7472e70951 Merge pull request #126 from Flast/patch-1
Remove outdated comment.
2016-03-07 19:26:41 +08:00
104f508cef Remove outdated comment. 2016-03-07 19:42:23 +09:00
f7b90f2981 Merge pull request #124 from Flast/feature/ticket-11157-remove-BOOST_PP_IS_EMPTY
Remove use of BOOST_PP_IS_EMPTY.
2016-02-17 04:45:16 +08:00
d314798241 Merge pull request #123 from Flast/drop-bom
Drop BOM.
2016-02-17 04:43:51 +08:00
5ed26ec932 Drop Byte-order-Marker. 2016-02-16 23:55:59 +09:00
4ebc028769 Optimize. 2016-02-16 19:32:57 +09:00
99ad77b92f Fix typos. 2016-02-16 16:52:27 +09:00
e3d16edfb3 Merge pull request #122 from Flast/suppress-warnings
Suppress conversion warnings on MSVC.
2016-02-16 02:19:41 +08:00
4173b4b97b Suppress conversion warnings on MSVC. 2016-02-16 01:02:58 +09:00
9b43ac8ee0 More optimization. 2016-02-16 00:40:27 +09:00
c9c2c3bad6 Optimize macros. 2016-02-14 23:53:38 +09:00
d7d47619b4 Tweak PP includes. 2016-02-14 23:41:22 +09:00
100d223be4 Merge pull request #121 from Flast/std-integer_sequence
Detect std::integer_sequence availability.
2016-02-13 13:21:14 +08:00
44c21e0f10 Fixes invalid use of hardcoded "obj." prefix for ADAPT_ASSOC_STRUCT_NAMED and btw. fixes test error since removal of BOOST_PP_IS_EMPTY. 2016-02-13 14:15:53 +09:00
3125c15ff4 Fix BOOST_PP_EMPTY replacement with adapt_assoc_struct 2016-02-13 14:15:53 +09:00
11cc331f82 Add test with namespaced names, as it could break with the macro concatenation to check for BOOST_MPL_PP_TOKEN_EQUAL_auto equality. 2016-02-13 14:15:53 +09:00
d1cd721969 Replace BOOST_FUSION_ADAPT_AUTO with the standard auto keyword.
While BOOST_FUSION_ADAPT_AUTO is still supported for backward compatibiltiy,
auto as been put because it has a better readability.
2016-02-13 14:15:53 +09:00
2e466ac054 Remove BOOST_PP_IS_EMPTY in favor of BOOST_MPL_PP_TOKEN_EQUAL and added auto as synonym for BOOST_FUSION_ADAPT_AUTO.
Fix ticket https://svn.boost.org/trac/boost/ticket/11157
BOOST_MPL_PP_TOKEN_EQUAL is now used to check if auto/BOOST_FUSION_ADAPT_AUTO
was provided as type, telling to deduce members types.
2016-02-13 14:15:53 +09:00
b88daeb697 Detect std::integer_sequence availability.
It will allow to reuse compiler cache easier.
2016-02-13 11:57:41 +09:00
1774972237 Merge pull request #120 from Flast/remove-trailing-void-support
Remove trailing void_ support on variadic vector.
2016-02-11 23:52:35 +08:00
b46aad996a Remove trailing void_ support on variadic vector. 2016-02-11 23:56:07 +09:00
0526f7c04f Merge pull request #118 from Flast/bugfix/ambiguous-ctor
Fix ambiguous ctor, close #11766
2016-01-08 05:39:51 +08:00
64b8406c16 Introduce detail::enabler instead of fusion::void_. 2015-12-10 17:06:04 +09:00
2492ff9b25 regen 2015-12-01 01:26:08 +09:00
3919f3ed73 Fix missing header. 2015-12-01 01:16:01 +09:00
12792a6c11 Fix compile error with ambiguous ctor, close #11766.
When a) first elem is sequence b) second (and third) elem is(are) void*,
both of conversion ctor and forwarding ctor are candidate since SFINAE
expression has void* type.
2015-12-01 01:14:52 +09:00
72912925cb Merge pull request #3 from correaa/patch-1
Update tag_of.hpp

Declare std::array with struct keyword, as per C++11, not class.
2014-02-08 10:28:43 +00:00
da294ebc6d Update tag_of.hpp
avoid mismatched-tags warning in clang
2014-02-07 22:24:29 -08:00
beba23f36c Merge pull request #2 from alfC/patch-1
Changed static assertion that checks array size
2014-02-04 11:52:57 -08:00
a2874ea5fe Changed static assertion that checks array size
to a more standard way. This avoids an obscure error involving `extension::std_array_size<Array>`
2014-02-04 11:33:06 -08:00
e12f59ebf2 Add Jonathan Wakely's opinion from Boost ml 2013-07-07 23:17:42 +01:00
0e24ec0a85 Format 2013-07-06 01:03:18 +01:00
31b1ee7f73 Link N3257 paper and the latest Boost thread 2013-07-06 00:57:08 +01:00
53a1a74a10 Refine the ADL comment 2013-07-06 00:55:58 +01:00
1e2841c683 Add comment on conflicts with C++11 range access 2013-07-05 23:51:23 +01:00
17928ac385 Call build-project to build test from top dir 2013-07-05 23:47:48 +01:00
789b86fd6c Wrap #pragma warning BOOST_MSVC 2013-07-05 23:46:46 +01:00
abb15d1158 Add all-in-one header for std_array 2013-07-04 00:57:44 +01:00
cccbc785d6 Include missing array_size.hpp 2013-07-04 00:57:22 +01:00
6849e31db0 Ignore bin directory 2013-07-04 00:56:53 +01:00
6c130b9e44 Fix ticket number 2013-07-02 13:38:38 +01:00
a49eb03483 Fix links 2013-07-02 13:31:37 +01:00
93a1fc3b87 Initial version of std::array for Boost.Fusion
Functional, though ADL issues have not been solved (see README).
2013-07-02 13:28:20 +01:00
149 changed files with 5298 additions and 828 deletions

View File

@ -25,4 +25,8 @@ boostbook quickbook
<format>pdf:<xsl:param>img.src.path=$(images_location)/
;
###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : quickbook ;
explicit boostrelease ;

View File

@ -227,7 +227,7 @@ __random_access_sequence__.
struct_name,
(member_type0, member_name0)
(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
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.
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 :
BOOST_FUSION_ADAPT_STRUCT(
demo::employee,
(BOOST_FUSION_ADAPT_AUTO, name)
(BOOST_FUSION_ADAPT_AUTO, age)
(auto, name)
(auto, age)
)
[endsect]
@ -298,7 +298,7 @@ __random_access_sequence__.
(struct_name) (specialization_param0)(specialization_param1)...,
(member_type0, member_name0)
(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
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.
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),
(Name, name)
(Age, age)
(BOOST_FUSION_ADAPT_AUTO, employment_timestamp))
(auto, employment_timestamp))
// Or by infering type completely
BOOST_FUSION_ADAPT_TPL_STRUCT(
@ -390,7 +390,7 @@ adapted using the given name.
struct_name, adapted_name,
(member_type0, member_name0)
(member_type1, member_name1)
(BOOST_FUSION_ADAPT_AUTO, member_name2),
(auto, member_name2),
...
)
@ -400,7 +400,7 @@ adapted using the given name.
adapted_name,
(member_type0, member_name0)
(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
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.
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 :
BOOST_FUSION_ADAPT_STRUCT_NAMED(
demo::employee, adapted_employee,
(BOOST_FUSION_ADAPT_AUTO, name),
(BOOST_FUSION_ADAPT_AUTO, age))
(auto, name),
(auto, age))
[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
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.
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 :
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
demo::employee,
(BOOST_FUSION_ADAPT_AUTO, name, keys::name),
(BOOST_FUSION_ADAPT_AUTO, age, keys::name))
(auto, name, keys::name),
(auto, age, keys::name))
[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
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.
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
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.
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 :
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
demo::employee, adapted_employee,
(BOOST_FUSION_ADAPT_AUTO, name, keys::name)
(BOOST_FUSION_ADAPT_AUTO, age, keys::age))
(auto, name, keys::name)
(auto, age, keys::age))
[endsect]
@ -713,7 +713,7 @@ instance of `type_name`.
[^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
[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
of an instance of `type_name`. This expression may access variables named
`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
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
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
of an instance of `type_name`. This expression may access variables named
`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
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
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
of an instance of `type_name`. This expression may access variables named
`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
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
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
of an instance of `type_name`. This expression may access variables named
`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/empty.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_const.hpp>
@ -45,13 +44,11 @@
TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \
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_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4) \
, 1, 0))
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4)) \
#define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \

View File

@ -14,7 +14,7 @@
#include <boost/fusion/support/config.hpp>
#include <boost/preprocessor/cat.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/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
@ -46,13 +46,11 @@
TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \
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_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \
, 1, 0)) \
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5)) \
\
template< \
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/preprocessor/control/if.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
@ -36,18 +38,18 @@
boost::remove_const<boost::remove_reference<lvalue>::type>::type
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE)
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE)
#ifdef BOOST_MSVC
# 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( \
TEMPLATE_PARAMS_SEQ) \
@ -55,52 +57,57 @@
struct deduced_attr_type { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
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( \
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \
ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \
};
#else
# 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 { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \
ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, 1)) type; \
};
#endif
#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( \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPLE_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
\
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_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 \
>::type type; \
\
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_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 \
>::type const_type;
#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_TUPEL_SIZE, 1, ATTRIBUTE) const_type;
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 0, ATTRIBUTE) type; \
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, 1, ATTRIBUTE) const_type;
#define BOOST_FUSION_ADAPT_ADT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \
ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
@ -116,7 +123,7 @@
BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \
NAME_SEQ, \
ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
PREFIX, \
TEMPLATE_PARAMS_SEQ) \
\
@ -128,7 +135,7 @@
Val const& val) \
{ \
PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \
\
BOOST_FUSION_GPU_ENABLED \
@ -137,7 +144,7 @@
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
{ \
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \
\
BOOST_FUSION_GPU_ENABLED \
@ -146,7 +153,7 @@
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
{ \
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
ATTRIBUTE_TUPLE_SIZE, DEDUCE_TYPE); \
} \
}; \
\
@ -160,7 +167,7 @@
> \
{ \
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< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \
@ -201,7 +208,7 @@
> \
{ \
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< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \
@ -252,7 +259,8 @@
, 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< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \

View File

@ -10,12 +10,15 @@
#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/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/empty.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#if BOOST_PP_VARIADICS
@ -41,7 +44,7 @@
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
#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))), \
((5, (A,B,C,D,E))) \
)
@ -55,7 +58,7 @@
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM( \
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))
#endif

View File

@ -9,23 +9,21 @@
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_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/preprocessor/arithmetic/sub.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/mpl/aux_/preprocessor/token_equal.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) \
@ -47,11 +45,15 @@
# define BOOST_FUSION_ADAPT_ADT_FILLER_0_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(...) \
BOOST_PP_IF( \
BOOST_PP_IIF( \
BOOST_PP_OR( \
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \
BOOST_MPL_PP_TOKEN_EQUAL(auto, \
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_PP_VARIADIC_ELEM(2, __VA_ARGS__), \
BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \
@ -63,7 +65,7 @@
# define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \
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__)))
#else // BOOST_PP_VARIADICS
@ -80,7 +82,7 @@
# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
# 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))), \
((4, (A,B,C,D))) \
)

View File

@ -0,0 +1,23 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY__01062013_1700)
#define BOOST_FUSION_STD_ARRAY__01062013_1700
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
#include <boost/fusion/adapted/std_array/tag_of.hpp>
#include <boost/fusion/adapted/std_array/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/begin_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/end_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/size_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/at_impl.hpp>
#include <boost/fusion/adapted/std_array/detail/value_at_impl.hpp>
#endif

View File

@ -0,0 +1,25 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_ARRAY_SIZE_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_ARRAY_SIZE_01062013_1700
#include <cstddef>
#include <type_traits>
namespace boost { namespace fusion
{
namespace extension
{
template<class T>
struct std_array_size;
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
struct std_array_size<Array<T, N>> : std::integral_constant<std::size_t, N> {};
}
}}
#endif

View File

@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_AT_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_AT_IMPL_01062013_1700
#include <boost/type_traits/is_const.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template<typename T>
struct at_impl;
template<>
struct at_impl<std_array_tag>
{
template<typename Sequence, typename N>
struct apply
{
typedef typename mpl::if_<
is_const<Sequence>,
typename Sequence::const_reference,
typename Sequence::reference>::type type;
static type
call(Sequence& seq)
{
return seq[N::value];
}
};
};
}
}}
#endif

View File

@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_BEGIN_OF_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_BEGIN_OF_IMPL_01062013_1700
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<std_array_tag>
{
template <typename Sequence>
struct apply
{
typedef std_array_iterator<Sequence, 0> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -0,0 +1,35 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_CATEGORY_OF_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_CATEGORY_OF_IMPL_01062013_1700
#include <boost/config/no_tr1/utility.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
struct random_access_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<std_array_tag>
{
template<typename T>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_END_OF_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_END_OF_IMPL_01062013_1700
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template <typename Tag>
struct end_impl;
template <>
struct end_impl<std_array_tag>
{
template <typename Sequence>
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
static int const size = std_array_size<seq_type>::value;
typedef std_array_iterator<Sequence, size> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_IS_SEQUENCE_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_IS_SEQUENCE_IMPL_01062013_1700
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<std_array_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@ -0,0 +1,33 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_IS_VIEW_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_IS_VIEW_IMPL_01062013_1700
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct std_array_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<std_array_tag>
{
template<typename T>
struct apply : mpl::false_
{};
};
}
}}
#endif

View File

@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_SIZE_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_SIZE_IMPL_01062013_1700
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template<typename T>
struct size_impl;
template<>
struct size_impl<std_array_tag>
{
template<typename Sequence>
struct apply
: mpl::int_
<
std_array_size
<
typename remove_const<Sequence>::type
>::value
>
{};
};
}
}}
#endif

View File

@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_VALUE_AT_IMPL_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_VALUE_AT_IMPL_01062013_1700
namespace boost { namespace fusion {
struct std_array_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <>
struct value_at_impl<std_array_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename Sequence::value_type type;
};
};
}
}}
#endif

View File

@ -0,0 +1,109 @@
/*=============================================================================
Copyright (c) 2013 Mateusz Loskot
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_ARRAY_ITERATOR_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_ARRAY_ITERATOR_01062013_1700
#include <cstddef>
#include <boost/config.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
template <typename Array, int Pos>
struct std_array_iterator
: iterator_facade<std_array_iterator<Array, Pos>, random_access_traversal_tag>
{
BOOST_MPL_ASSERT_RELATION(Pos, >=, 0);
BOOST_MPL_ASSERT_RELATION(Pos, <=, std::tuple_size<Array>::value);
typedef mpl::int_<Pos> index;
typedef Array array_type;
std_array_iterator(Array& a)
: array(a) {}
Array& array;
template <typename Iterator>
struct value_of
{
typedef typename Iterator::array_type array_type;
typedef typename array_type::value_type type;
};
template <typename Iterator>
struct deref
{
typedef typename Iterator::array_type array_type;
typedef typename
mpl::if_<
is_const<array_type>
, typename array_type::const_reference
, typename array_type::reference
>::type
type;
static type
call(Iterator const & it)
{
return it.array[Iterator::index::value];
}
};
template <typename Iterator, typename N>
struct advance
{
typedef typename Iterator::index index;
typedef typename Iterator::array_type array_type;
typedef std_array_iterator<array_type, index::value + N::value> type;
static type
call(Iterator const& i)
{
return type(i.array);
}
};
template <typename Iterator>
struct next : advance<Iterator, mpl::int_<1> > {};
template <typename Iterator>
struct prior : advance<Iterator, mpl::int_<-1> > {};
template <typename I1, typename I2>
struct distance : mpl::minus<typename I2::index, typename I1::index>
{
typedef typename
mpl::minus<
typename I2::index, typename I1::index
>::type
type;
static type
call(I1 const&, I2 const&)
{
return type();
}
};
private:
std_array_iterator<Array, Pos>& operator=(std_array_iterator<Array, Pos> const&);
};
}}
#endif

View File

@ -0,0 +1,52 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_STD_ARRAY_TAG_OF_01062013_1700)
#define BOOST_FUSION_STD_ARRAY_TAG_OF_01062013_1700
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <array>
#include <cstddef>
namespace boost { namespace fusion
{
struct std_array_tag;
struct fusion_sequence_tag;
namespace traits
{
template<typename T, std::size_t N>
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
struct tag_of<std::array<T,N>, void >
#else
struct tag_of<std::array<T,N> >
#endif
{
typedef std_array_tag type;
};
}
}}
namespace boost { namespace mpl
{
template<typename>
struct sequence_tag;
template<typename T, std::size_t N>
struct sequence_tag<std::array<T,N> >
{
typedef fusion::fusion_sequence_tag type;
};
template<typename T, std::size_t N>
struct sequence_tag<std::array<T,N> const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif

View File

@ -13,7 +13,8 @@
#include <boost/fusion/support/config.hpp>
#include <boost/preprocessor/cat.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/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
@ -44,11 +45,11 @@
NAME_SEQ, \
IS_VIEW, \
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_SIZE(ATTRIBUTE), \
BOOST_PP_IF(BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3)) \
\
template< \
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/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( \
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
\
@ -27,9 +20,7 @@
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \
_END))
ATTRIBUTES)
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \

View File

@ -14,9 +14,8 @@
#include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/cat.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/equal.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/type_traits/add_reference.hpp>
@ -45,13 +44,11 @@
NAME_SEQ, \
IS_VIEW, \
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_SIZE(ATTRIBUTE), \
BOOST_PP_IF( \
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2) \
, 1, 0))
BOOST_PP_LESS( \
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2))
@ -86,7 +83,7 @@
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
BOOST_FUSION_ADAPT_STRUCT_C)
#else // BOOST_PP_VARIADICS
# define BOOST_FUSION_ADAPT_TPL_STRUCT( \

View File

@ -13,7 +13,7 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.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

View File

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

View File

@ -8,8 +8,7 @@
#ifndef 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 BOOST_PP_EMPTY()
#define BOOST_FUSION_ADAPT_AUTO auto
#define BOOST_MPL_PP_TOKEN_EQUAL_auto(x) x
#endif

View File

@ -29,6 +29,7 @@
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/comparison/less.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/tag.hpp>
#include <boost/mpl/eval_if.hpp>
@ -64,7 +65,7 @@
#ifdef BOOST_MSVC
# 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( \
TEMPLATE_PARAMS_SEQ) \
@ -73,7 +74,7 @@
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
typedef \
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)) \
type; \
}; \
@ -84,12 +85,12 @@
#else
# 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 { \
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
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; \
}; \
\
@ -100,9 +101,9 @@
#endif
#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 \
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
@ -159,7 +160,7 @@
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \
I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \
I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPLE_SIZE, \
DEDUCE_TYPE) \
\
template< \
@ -174,7 +175,7 @@
BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \
NAME_SEQ, \
ATTRIBUTE, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
PREFIX, \
TEMPLATE_PARAMS_SEQ) \
\
@ -201,8 +202,8 @@
call(Seq& seq) \
{ \
return seq.PREFIX() \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE); \
} \
}; \
}; \
@ -222,9 +223,8 @@
call() \
{ \
return BOOST_PP_STRINGIZE( \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \
ATTRIBUTE)); \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_NOT(DEDUCE_TYPE), ATTRIBUTE)); \
} \
};
@ -274,7 +274,7 @@ namespace boost
struct struct_is_view< \
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/fusion/adapted/struct/detail/adapt_auto.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/mpl/aux_/preprocessor/token_equal.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/empty.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/variadic/elem.hpp>
#if BOOST_PP_VARIADICS
@ -29,7 +32,14 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
#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
@ -43,7 +53,7 @@
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
#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))), \
((3, (X,Y,Z))) \
)
@ -57,7 +67,7 @@
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM( \
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))
#endif

View File

@ -9,15 +9,21 @@
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_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/preprocessor/empty.hpp>
#include <boost/preprocessor/tuple/size.hpp>
#include <boost/mpl/aux_/preprocessor/token_equal.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/facilities/is_empty.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/seq/for_each.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) \
@ -32,7 +38,7 @@
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
#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))), \
((2, (X,Y))) \
)
@ -47,12 +53,10 @@
#if BOOST_PP_VARIADICS
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \
BOOST_PP_IF(BOOST_FUSION_PP_IS_SEQ(elem), \
BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \
BOOST_PP_IF(BOOST_PP_IS_EMPTY(elem), \
BOOST_PP_EMPTY(), \
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO,elem))\
)
BOOST_PP_IIF(BOOST_FUSION_PP_IS_SEQ(elem), \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \
BOOST_PP_EXPR_IIF(BOOST_PP_COMPL(BOOST_PP_IS_EMPTY(elem)), \
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(auto, elem)))
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \
BOOST_PP_SEQ_PUSH_FRONT( \

View File

@ -8,6 +8,8 @@
#ifndef 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) \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)

View File

@ -10,19 +10,18 @@
#include <boost/fusion/support/config.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
#include <boost/fusion/adapted/struct/detail/namespace.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/expr_if.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
@ -41,15 +40,65 @@
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END
#ifdef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#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_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \
other_self.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_TUPLE_SIZE,1,ATTRIBUTE))
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
NAME(self_type const& other_self) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{}
// Use templated version instead.
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \
other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
self_type& operator=(self_type const& other) \
{ \
BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
\
return *this; \
}
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED NAME(self_type const&) = default;
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type const&) = default;
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
\
BOOST_PP_EXPR_IF( \
I_, \
@ -62,11 +111,11 @@
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_));
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
template<typename Seq> \
BOOST_FUSION_GPU_ENABLED \
@ -81,51 +130,126 @@
BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
\
return *this; \
}
#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPEL_SIZE, ATTRIBUTE) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE);
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR(NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#else // BOOST_NO_CXX11_RVALUE_REFERENCES
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
|| BOOST_WORKAROUND(BOOST_GCC, < 40500) \
|| BOOST_WORKAROUND(BOOST_MSVC, == 1800)
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(std::move( \
other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)))
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
NAME(self_type&& other_self) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{}
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED NAME(self_type&&) = default;
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
|| BOOST_WORKAROUND(BOOST_GCC, < 40600) \
|| BOOST_WORKAROUND(BOOST_MSVC, == 1800)
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)=std::move( \
other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE));
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
self_type& operator=(self_type&& other) \
{ \
BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
\
return *this; \
}
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type&&) = default;
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPLE_SIZE, ATTRIBUTE) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
boost::fusion::deref(boost::fusion::advance_c<I>(boost::fusion::begin( \
seq))))
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
, typename boost::disable_if< \
boost::is_convertible< \
Seq const& \
, BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
> \
>::type* =0
#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_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)()
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)()
#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( \
1, \
BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
\
BOOST_FUSION_GPU_ENABLED \
@ -133,18 +257,14 @@
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{} \
\
BOOST_FUSION_GPU_ENABLED \
NAME(self_type const& other_self) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{} \
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
template<typename Seq> \
BOOST_FUSION_GPU_ENABLED \
@ -153,53 +273,57 @@
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_PP_TUPLE_EAT(2), \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{} \
\
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
explicit \
NAME(boost::call_traits< \
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) \
: 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( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
explicit \
NAME(typename boost::call_traits< \
typename boost::fusion::detail::get_first_arg< \
BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
, BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
>::type \
>::param_type arg) \
: 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( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
\
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) \
\
@ -215,14 +339,14 @@
>::param_type BOOST_PP_CAT(_,I)
#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 \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
( \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
), \
@ -230,77 +354,64 @@
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{}
#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::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)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ)) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTE_TUPLE_SIZE, \
ATTRIBUTES_SEQ) \
{}
#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_FUSION_DEFINE_STRUCT_CTOR_N, \
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( \
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_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \
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( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
\
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( \
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( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
template<typename Seq> \
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(Seq const&) \
{} \
\
template<typename Seq> \
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
self_type& \
operator=(Seq const& seq) \
{ \
return *this; \
}
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#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) \
\
@ -311,35 +422,32 @@
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_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)
#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( \
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( \
TEMPLATE_PARAMS_SEQ, \
NAME, \
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \
ATTRIBUTE_TUPEL_SIZE)
ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, \
NAMESPACE_SEQ, \
NAME, \
ATTRIBUTES_SEQ, \
ATTRIBUTE_TUPEL_SIZE) \
ATTRIBUTE_TUPLE_SIZE) \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\
@ -354,7 +462,7 @@
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_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)

View File

@ -22,7 +22,7 @@
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.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/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/size.hpp>
@ -62,7 +62,6 @@
~, \
ATTRIBUTES_SEQ) \
#define BOOST_FUSION_IGNORE_1(ARG1)
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
@ -425,17 +424,10 @@
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \
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() \
BOOST_PP_IF( \
ATTRIBUTES_SEQ_SIZE, \
BOOST_PP_IF(ATTRIBUTES_SEQ_SIZE, \
BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \
BOOST_FUSION_IGNORE_1) \
(BOOST_PP_IF( \
ATTRIBUTES_SEQ_SIZE, \
ATTRIBUTES_SEQ, \
0)) \
BOOST_PP_EMPTY)(ATTRIBUTES_SEQ) \
{ \
} \
\

View File

@ -13,8 +13,6 @@
#ifndef 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/cat.hpp>
#include <boost/preprocessor/config/config.hpp>

View File

@ -17,6 +17,7 @@
#include <boost/type_traits/add_reference.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>

View File

@ -21,6 +21,8 @@
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
@ -59,7 +61,7 @@ namespace boost { namespace fusion
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence>>>::type* /*dummy*/ = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence>>, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
@ -149,8 +151,8 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* /*dummy*/ = 0)
, typename disable_if<is_convertible<Sequence, Head>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}

View File

@ -23,8 +23,7 @@
# endif
#endif
// MSVC variadics at this point in time is not ready yet (ICE!)
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1900))
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
# if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
# undef BOOST_FUSION_HAS_VARIADIC_DEQUE
# endif

View File

@ -35,6 +35,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/utility/enable_if.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
@ -102,8 +103,8 @@ namespace boost { namespace fusion {
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* /*dummy*/ = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
@ -133,7 +134,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* /*dummy*/ = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element())
{}
@ -146,7 +147,8 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq
, typename disable_if<
is_convertible<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>, T0>
>::type* /*dummy*/ = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(seq))
{}
template <typename T>
@ -180,7 +182,7 @@ FUSION_HASH endif
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* /*dummy*/ = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED

View File

@ -202,8 +202,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
@ -226,7 +226,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
{}
@ -239,7 +239,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>&& seq
, typename disable_if<
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>, T0>
>::type* = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>>(seq))
{}
template <typename T>
@ -267,7 +268,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}

View File

@ -382,8 +382,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19>
@ -406,7 +406,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
{}
@ -419,7 +419,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19>&& seq
, typename disable_if<
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19>, T0>
>::type* = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19>>(seq))
{}
template <typename T>
@ -447,7 +448,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}

View File

@ -562,8 +562,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29>
@ -586,7 +586,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
{}
@ -599,7 +599,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29>&& seq
, typename disable_if<
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29>, T0>
>::type* = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29>>(seq))
{}
template <typename T>
@ -627,7 +628,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}

View File

@ -742,8 +742,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39>
@ -766,7 +766,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
{}
@ -779,7 +779,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39>&& seq
, typename disable_if<
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39>, T0>
>::type* = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39>>(seq))
{}
template <typename T>
@ -807,7 +808,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}

View File

@ -922,8 +922,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template<typename Sequence>
BOOST_FUSION_GPU_ENABLED
deque(Sequence const& seq
, typename disable_if<is_convertible<Sequence, T0> >::type* = 0
, typename enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9 , typename U10 , typename U11 , typename U12 , typename U13 , typename U14 , typename U15 , typename U16 , typename U17 , typename U18 , typename U19 , typename U20 , typename U21 , typename U22 , typename U23 , typename U24 , typename U25 , typename U26 , typename U27 , typename U28 , typename U29 , typename U30 , typename U31 , typename U32 , typename U33 , typename U34 , typename U35 , typename U36 , typename U37 , typename U38 , typename U39 , typename U40 , typename U41 , typename U42 , typename U43 , typename U44 , typename U45 , typename U46 , typename U47 , typename U48 , typename U49>
@ -946,7 +946,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
template <typename T0_>
BOOST_FUSION_GPU_ENABLED
explicit deque(T0_&& t0
, typename enable_if<is_convertible<T0_, T0> >::type* = 0
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
)
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
{}
@ -959,7 +959,8 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47 , U48 , U49>&& seq
, typename disable_if<
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47 , U48 , U49>, T0>
>::type* = 0)
, detail::enabler_
>::type = detail::enabler)
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9 , U10 , U11 , U12 , U13 , U14 , U15 , U16 , U17 , U18 , U19 , U20 , U21 , U22 , U23 , U24 , U25 , U26 , U27 , U28 , U29 , U30 , U31 , U32 , U33 , U34 , U35 , U36 , U37 , U38 , U39 , U40 , U41 , U42 , U43 , U44 , U45 , U46 , U47 , U48 , U49>>(seq))
{}
template <typename T>
@ -987,7 +988,7 @@ deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_
typename enable_if<
mpl::and_<
traits::is_sequence<Sequence>
, result_of::empty<Sequence> > >::type* = 0) BOOST_NOEXCEPT
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
deque() BOOST_NOEXCEPT {}

View File

@ -59,7 +59,7 @@ namespace boost { namespace fusion { namespace detail
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
keyed_element(keyed_element&& rhs)
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rhs.forward_base()))
: Rest(rhs.forward_base())
, value_(BOOST_FUSION_FWD_ELEM(Value, rhs.value_))
{}
#endif
@ -90,7 +90,7 @@ namespace boost { namespace fusion { namespace detail
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
Rest&& forward_base() BOOST_NOEXCEPT
{
return BOOST_FUSION_FWD_ELEM(Rest, *static_cast<Rest*>(this));
return std::move(*static_cast<Rest*>(this));
}
#endif
@ -116,7 +116,7 @@ namespace boost { namespace fusion { namespace detail
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
keyed_element(Value&& value, Rest&& rest)
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rest))
: Rest(std::move(rest))
, value_(BOOST_FUSION_FWD_ELEM(Value, value))
{}
#endif
@ -147,8 +147,8 @@ namespace boost { namespace fusion { namespace detail
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
keyed_element& operator=(keyed_element&& rhs)
{
base::operator=(std::forward<keyed_element>(rhs));
value_ = BOOST_FUSION_FWD_ELEM(Value, rhs.value_);
base::operator=(rhs.forward_base());
value_ = std::move(rhs.value_);
return *this;
}
#endif

View File

@ -30,33 +30,13 @@ namespace boost { namespace fusion
template <typename ...T>
struct make_vector
{
// make `make_vector<T..., void_...>' into `make_vector<T...>'
template <typename, typename...> struct trim_void;
template <typename... U>
struct trim_void<vector<U...> >
{
typedef vector<U...> type;
};
template <typename... U, typename... Tail>
struct trim_void<vector<U...>, void_, Tail...>
: trim_void<vector<U...> > { };
template <typename... U, typename Head, typename... Tail>
struct trim_void<vector<U...>, Head, Tail...>
: trim_void<vector<U..., Head>, Tail...> { };
typedef
typename trim_void<
vector<>
, typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...
>::type
type;
typedef vector<
typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...
> type;
};
}

View File

@ -9,6 +9,8 @@
#define FUSION_CONS_07172005_0843
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/container/list/cons_fwd.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
@ -34,7 +36,6 @@
namespace boost { namespace fusion
{
struct void_;
struct cons_tag;
struct forward_traversal_tag;
struct fusion_sequence_tag;
@ -82,7 +83,8 @@ namespace boost { namespace fusion
traits::is_sequence<Sequence>
, mpl::not_<is_base_of<cons, Sequence> >
, mpl::not_<is_convertible<Sequence, Car> > > // use copy to car instead
>::type* /*dummy*/ = 0
, detail::enabler_
>::type = detail::enabler
)
: car(*fusion::begin(seq))
, cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {}

View File

@ -8,6 +8,8 @@
#define FUSION_LIST_07172005_1153
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/container/list/detail/cpp03/list_fwd.hpp>
#include <boost/fusion/container/list/detail/cpp03/list_to_cons.hpp>
#include <boost/fusion/support/is_sequence.hpp>
@ -61,7 +63,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}
// Expand a couple of forwarding constructors for arguments

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}

View File

@ -30,7 +30,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
list(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: inherited_type(rhs) {}

View File

@ -35,6 +35,8 @@
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/utility/enable_if.hpp>
@ -68,21 +70,21 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
map(Sequence const& seq
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
map(Sequence& seq
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
map(Sequence&& seq
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: base_type(begin(seq), detail::map_impl_from_iterator())
{}

View File

@ -23,8 +23,7 @@
# endif
#endif
// MSVC variadics at this point in time is not ready yet (ICE!)
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1900))
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
# if defined(BOOST_FUSION_HAS_VARIADIC_MAP)
# undef BOOST_FUSION_HAS_VARIADIC_MAP
# endif

View File

@ -8,7 +8,6 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9> >
@ -27,7 +26,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit

View File

@ -8,7 +8,6 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19> >
@ -27,7 +26,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit

View File

@ -8,7 +8,6 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29> >
@ -27,7 +26,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit

View File

@ -8,7 +8,6 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29 , T30 , T31 , T32 , T33 , T34 , T35 , T36 , T37 , T38 , T39> >
@ -27,7 +26,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit

View File

@ -8,7 +8,6 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46 , typename T47 , typename T48 , typename T49>
struct set : sequence_base<set<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 , T20 , T21 , T22 , T23 , T24 , T25 , T26 , T27 , T28 , T29 , T30 , T31 , T32 , T33 , T34 , T35 , T36 , T37 , T38 , T39 , T40 , T41 , T42 , T43 , T44 , T45 , T46 , T47 , T48 , T49> >
@ -27,7 +26,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit

View File

@ -8,6 +8,8 @@
#define FUSION_SET_09162005_1104
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/category_of.hpp>
@ -47,7 +49,6 @@
namespace boost { namespace fusion
{
struct void_;
struct fusion_sequence_tag;
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, typename T)>
@ -72,7 +73,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
#include <boost/fusion/container/set/detail/cpp03/set_forward_ctor.hpp>

View File

@ -21,6 +21,8 @@
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/is_sequence.hpp>
@ -60,8 +62,8 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs,
typename enable_if<traits::is_sequence<Sequence> >::type* = 0,
typename enable_if<detail::is_same_size<Sequence, storage_type> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler,
typename enable_if<detail::is_same_size<Sequence, storage_type>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
template <typename T>
@ -102,8 +104,8 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence&& rhs,
typename enable_if<traits::is_sequence<Sequence> >::type* = 0,
typename enable_if<detail::is_same_size<Sequence, storage_type> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler,
typename enable_if<detail::is_same_size<Sequence, storage_type>, detail::enabler_>::type = detail::enabler)
: data(std::forward<Sequence>(rhs)) {}
template <typename ...U>

View File

@ -15,6 +15,8 @@
|| defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|| defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) \
|| defined(BOOST_NO_CXX11_DECLTYPE)) \
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|| defined(BOOST_FUSION_DISABLE_VARIADIC_VECTOR) \
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
@ -25,8 +27,7 @@
# endif
#endif
// Sometimes, MSVC 12 shows compile error with std::size_t of template parameter.
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
# endif

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}

View File

@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}

View File

@ -11,6 +11,8 @@
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/detail/cpp03/vector_n_chooser.hpp>
@ -118,7 +120,7 @@ namespace boost { namespace fusion
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
vector(Sequence const& rhs,
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
: vec(BOOST_FUSION_VECTOR_COPY_INIT()) {}
// Expand a couple of forwarding constructors for arguments

View File

@ -24,21 +24,21 @@
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/detail/and.hpp>
#include <boost/fusion/support/detail/index_sequence.hpp>
#include <boost/fusion/container/vector/detail/at_impl.hpp>
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/fusion/container/vector/detail/begin_impl.hpp>
#include <boost/fusion/container/vector/detail/end_impl.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <cstddef>
#include <utility>
@ -51,52 +51,48 @@ namespace boost { namespace fusion
namespace vector_detail
{
struct each_elem {};
struct copy_or_move {};
template <typename I> struct from_sequence {};
template <typename Sequence>
struct make_indices_from_seq
: detail::make_index_sequence<
fusion::result_of::size<typename remove_reference<Sequence>::type>::value
template <
typename This, typename T, typename T_, std::size_t Size, bool IsSeq
>
struct can_convert_impl : false_type {};
template <typename This, typename T, typename Sequence, std::size_t Size>
struct can_convert_impl<This, T, Sequence, Size, true> : true_type {};
template <typename This, typename Sequence, typename T>
struct can_convert_impl<This, Sequence, T, 1, true>
: integral_constant<
bool
, !is_convertible<
Sequence
, typename fusion::extension::value_at_impl<vector_tag>::
template apply< This, mpl::int_<0> >::type
>::value
>
{};
template <typename T>
struct pure : remove_cv<typename remove_reference<T>::type> {};
template <typename Sequence, typename This, int = result_of::size<This>::value>
struct is_convertible_to_first
: boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
template <typename This, typename T, typename T_, std::size_t Size>
struct can_convert
: can_convert_impl<
This, T, T_, Size, traits::is_sequence<T_>::value
>
{};
template <typename Sequence, typename This>
struct is_convertible_to_first<Sequence, This, 0>
: mpl::false_
template <typename T, bool IsSeq, std::size_t Size>
struct is_longer_sequence_impl : false_type {};
template <typename Sequence, std::size_t Size>
struct is_longer_sequence_impl<Sequence, true, Size>
: integral_constant<
bool, (fusion::result_of::size<Sequence>::value >= Size)
>
{};
template <typename This, typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline each_elem
dispatch(T const&...) BOOST_NOEXCEPT { return each_elem(); }
template <typename This>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline copy_or_move
dispatch(This const&) BOOST_NOEXCEPT { return copy_or_move(); }
template <typename This, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline from_sequence<
typename lazy_enable_if_c<
(traits::is_sequence<typename remove_reference<Sequence>::type>::value &&
!is_same<This, typename pure<Sequence>::type>::value &&
!is_convertible_to_first<Sequence, This>::value)
, make_indices_from_seq<Sequence>
>::type
>
dispatch(Sequence&&) BOOST_NOEXCEPT
{ return from_sequence<typename make_indices_from_seq<Sequence>::type>(); }
template<typename T, std::size_t Size>
struct is_longer_sequence
: is_longer_sequence_impl<T, traits::is_sequence<T>::value, Size>
{};
// forward_at_c allows to access Nth element even if ForwardSequence
// since fusion::at_c requires RandomAccessSequence.
@ -161,22 +157,17 @@ namespace boost { namespace fusion
return *this;
}
template <typename U>
template <
typename U
, typename = typename boost::disable_if<
is_base_of<store, typename remove_reference<U>::type>
>::type
>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store(U&& rhs
, typename disable_if<is_same<typename pure<U>::type, store> >::type* = 0)
store(U&& rhs)
: elem(std::forward<U>(rhs))
{}
template <typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename disable_if<is_same<typename pure<U>::type, store>, store&>::type
operator=(U&& rhs)
{
elem = std::forward<U>(rhs);
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
T & get() { return elem; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
@ -204,21 +195,17 @@ namespace boost { namespace fusion
vector_data()
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_data(copy_or_move, vector_data const& rhs)
: store<I, T>(static_cast<store<I, T> const&>(rhs))...
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_data(copy_or_move, vector_data&& rhs)
: store<I, T>(std::forward<store<I, T> >(rhs))...
{}
template <typename Sequence>
template <
typename Sequence
, typename Sequence_ = typename remove_reference<Sequence>::type
, typename = typename boost::enable_if<
can_convert<vector_data, Sequence, Sequence_, sizeof...(I)>
>::type
>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
vector_data(from_sequence<detail::index_sequence<I...> >, Sequence&& rhs)
: store<I, T>(forward_at_c<I>(rhs))...
vector_data(each_elem, Sequence&& rhs)
: store<I, T>(forward_at_c<I>(std::forward<Sequence>(rhs)))...
{}
template <typename ...U>
@ -228,6 +215,14 @@ namespace boost { namespace fusion
: store<I, T>(std::forward<U>(var))...
{}
template <typename Sequence>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
assign_sequence(Sequence&& seq)
{
assign(std::forward<Sequence>(seq), detail::index_sequence<I...>());
}
template <typename Sequence>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
@ -274,51 +269,54 @@ namespace boost { namespace fusion
static BOOST_FUSION_GPU_ENABLED
mpl::identity<U> value_at_impl(store<N, U>*);
};
template <typename V, typename... T>
struct trim_void_;
template <typename... T>
struct trim_void_<vector<T...> >
{
typedef vector_data<
typename detail::make_index_sequence<sizeof...(T)>::type
, T...
> type;
};
template <typename... T, typename... Tail>
struct trim_void_<vector<T...>, void_, Tail...>
: trim_void_<vector<T...> > {};
template <typename... T, typename Head, typename... Tail>
struct trim_void_<vector<T...>, Head, Tail...>
: trim_void_<vector<T..., Head>, Tail...> {};
template <typename... T>
struct trim_void : trim_void_<vector<>, T...> {};
} // namespace boost::fusion::vector_detail
// This class provides backward compatibility: vector<T, ..., void_, void_, ...>.
template <typename... T>
struct vector
: vector_detail::trim_void<T...>::type
: vector_detail::vector_data<
typename detail::make_index_sequence<sizeof...(T)>::type
, T...
>
{
typedef typename vector_detail::trim_void<T...>::type base;
typedef vector_detail::vector_data<
typename detail::make_index_sequence<sizeof...(T)>::type
, T...
> base;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector()
{}
// rvalue-references is required here in order to forward any arguments to
// base: vector(T const&...) doesn't work with trailing void_ and
// vector(U const&...) cannot forward any arguments to base.
template <typename... U>
template <
typename... U
, typename = typename boost::enable_if_c<(
sizeof...(U) >= 1 &&
fusion::detail::and_<is_convertible<U, T>...>::value &&
!fusion::detail::and_<
is_base_of<vector, typename remove_reference<U>::type>...
>::value
)>::type
>
// XXX: constexpr become error due to pull-request #79, booooo!!
// In the (near) future release, should be fixed.
/* BOOST_CONSTEXPR */ BOOST_FUSION_GPU_ENABLED
vector(U&&... u)
: base(vector_detail::dispatch<vector>(std::forward<U>(u)...), std::forward<U>(u)...)
explicit vector(U&&... u)
: base(vector_detail::each_elem(), std::forward<U>(u)...)
{}
template <
typename Sequence
, typename Sequence_ = typename remove_reference<Sequence>::type
, typename = typename boost::enable_if_c<(
!is_base_of<vector, Sequence_>::value &&
vector_detail::is_longer_sequence<
Sequence_, sizeof...(T)
>::value
)>::type
>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector(Sequence&& seq)
: base(vector_detail::each_elem(), std::forward<Sequence>(seq))
{}
template <typename Sequence>
@ -326,10 +324,7 @@ namespace boost { namespace fusion
vector&
operator=(Sequence&& rhs)
{
typedef typename
vector_detail::make_indices_from_seq<Sequence>::type
indices;
base::assign(std::forward<Sequence>(rhs), indices());
base::assign_sequence(std::forward<Sequence>(rhs));
return *this;
}
};

View File

@ -1,13 +1,13 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2017 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_INCLUDE_ADAPT_ADT_NAMED)
#define FUSION_INCLUDE_ADAPT_ADT_NAMED
#if !defined(FUSION_INCLUDE_STD_ARRAY)
#define FUSION_INCLUDE_STD_ARRAY
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
#include <boost/fusion/adapted/std_array.hpp>
#endif

View File

@ -8,6 +8,14 @@
#define FUSION_CONVERT_10022005_1442
#include <boost/fusion/support/config.hpp>
#if BOOST_WORKAROUND(BOOST_GCC, < 30500)
#include <boost/core/enable_if.hpp>
#include <boost/type_traits/is_const.hpp>
#define BOOST_FUSION_WA_GCC34(type1, type2) \
boost::lazy_disable_if<boost::is_const<Sequence>, type1, type2>
#else
#define BOOST_FUSION_WA_GCC34(type1, type2) type1, type2
#endif
namespace boost { namespace fusion
{
@ -32,7 +40,7 @@ namespace boost { namespace fusion
template <typename Tag, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::convert<Tag, Sequence>::type
inline typename BOOST_FUSION_WA_GCC34(result_of::convert<Tag, Sequence>)::type
convert(Sequence& seq)
{
typedef typename result_of::convert<Tag, Sequence>::gen gen;
@ -49,4 +57,5 @@ namespace boost { namespace fusion
}
}}
#undef BOOST_FUSION_WA_GCC34
#endif

View File

@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2016 Lee Clagett
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef FUSION_AND_07152016_1625
#define FUSION_AND_07152016_1625
#include <boost/config.hpp>
#include <boost/type_traits/integral_constant.hpp>
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#error fusion::detail::and_ requires variadic templates
#endif
namespace boost { namespace fusion { namespace detail {
template<typename ...Cond>
struct and_impl : false_type {};
template<typename ...T>
struct and_impl<integral_constant<T, true>...> : true_type {};
// This specialization is necessary to avoid MSVC-12 variadics bug.
template<bool ...Cond>
struct and_impl1 : and_impl<integral_constant<bool, Cond>...> {};
/* fusion::detail::and_ differs from mpl::and_ in the following ways:
- The empty set is valid and returns true
- A single element set is valid and returns the identity
- There is no upper bound on the set size
- The conditions are evaluated at once, and are not short-circuited. This
reduces instantations when returning true; the implementation is not
recursive. */
template<typename ...Cond>
struct and_ : and_impl1<Cond::value...> {};
}}}
#endif // FUSION_AND_07152016_1625

View File

@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_SUPPORT_DETAIL_ENABLER_12102015_0346
#define BOOST_FUSION_SUPPORT_DETAIL_ENABLER_12102015_0346
#include <boost/config.hpp>
namespace boost { namespace fusion { namespace detail
{
struct enabler_ {};
BOOST_STATIC_CONSTEXPR enabler_ enabler = {};
}}}
#endif

View File

@ -12,8 +12,27 @@
#include <boost/fusion/support/config.hpp>
#include <cstddef>
// GCC5 has O(logN) implementation, see https://gcc.gnu.org/PR66059 .
#if (defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304) \
|| (defined(BOOST_LIBSTDCXX_VERSION) \
&& BOOST_LIBSTDCXX_VERSION >= 500000 && __cplusplus >= 201402)
#include <utility>
#define BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE
#endif
namespace boost { namespace fusion { namespace detail
{
#ifdef BOOST_FUSION_STDLIB_HAS_INTEGER_SEQUENCE
// Use aliasing templates without checking availability, the compiler should work.
template <std::size_t ...Ints>
using index_sequence = std::index_sequence<Ints...>;
template <std::size_t N>
struct make_index_sequence
{
using type = std::make_index_sequence<N>;
};
#else
template <std::size_t ...Ints>
struct index_sequence
{
@ -53,6 +72,7 @@ namespace boost { namespace fusion { namespace detail
struct make_index_sequence<0>
: index_sequence<>
{};
#endif
}}}
#endif

View File

@ -20,12 +20,15 @@
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/core/enable_if.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/comparison.hpp>
#include <boost/fusion/sequence/io.hpp>
#include <boost/fusion/support/detail/and.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <utility>
namespace boost { namespace fusion
@ -39,23 +42,49 @@ namespace boost { namespace fusion
tuple()
: base_type() {}
template <typename ...U>
template <
typename ...U
, typename = typename boost::enable_if_c<
sizeof...(U) >= sizeof...(T)
>::type
>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(tuple<U...> const& other)
: base_type(other) {}
template <typename ...U>
template <
typename ...U
, typename = typename boost::enable_if_c<
sizeof...(U) >= sizeof...(T)
>::type
>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(tuple<U...>&& other)
: base_type(std::move(other)) {}
template <typename ...U>
template <
typename ...U
, typename = typename boost::enable_if_c<(
fusion::detail::and_<is_convertible<U, T>...>::value &&
sizeof...(U) >= 1
)>::type
>
/*BOOST_CONSTEXPR*/ BOOST_FUSION_GPU_ENABLED
explicit
tuple(U&&... args)
: base_type(std::forward<U>(args)...) {}
template <typename U>
template<typename U1, typename U2>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(std::pair<U1, U2> const& other)
: base_type(other.first, other.second) {}
template<typename U1, typename U2>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(std::pair<U1, U2>&& other)
: base_type(std::move(other.first), std::move(other.second)) {}
template<typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple& operator=(U&& rhs)
{

View File

@ -8,6 +8,7 @@
#define BOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
@ -409,11 +410,14 @@ namespace boost { namespace fusion { namespace detail
template <
typename StackBegin
, typename StackEnd
, bool SameSegment =
result_of::equal_to<
, bool SameSegment
#if !(BOOST_WORKAROUND(BOOST_GCC, >= 40000) && BOOST_WORKAROUND(BOOST_GCC, < 40200))
= result_of::equal_to<
typename StackBegin::car_type::begin_type
, typename StackEnd::car_type::begin_type
>::type::value>
>::type::value
#endif
>
struct make_segmented_range_reduce2
{
typedef
@ -480,7 +484,14 @@ namespace boost { namespace fusion { namespace detail
template <typename StackBegin, typename StackEnd, int StackBeginSize, int StackEndSize>
struct make_segmented_range_reduce
: make_segmented_range_reduce2<StackBegin, StackEnd>
: make_segmented_range_reduce2<StackBegin, StackEnd
#if BOOST_WORKAROUND(BOOST_GCC, >= 40000) && BOOST_WORKAROUND(BOOST_GCC, < 40200)
, result_of::equal_to<
typename StackBegin::car_type::begin_type
, typename StackEnd::car_type::begin_type
>::type::value
#endif
>
{};
template <typename StackBegin, typename StackEnd>

View File

@ -39,7 +39,10 @@ namespace boost { namespace fusion
static type
call(Iterator const& i)
{
BOOST_STATIC_ASSERT((type::position::value < 2));
// Workaround for ICE on GCC 4.0.0.
// see https://svn.boost.org/trac/boost/ticket/5808
typedef typename type::position position;
BOOST_STATIC_ASSERT((position::value < 2));
return type(i.view);
}
};

View File

@ -126,7 +126,7 @@ namespace boost { namespace fusion {
zip_view(
const Sequences& seqs)
: sequences_(seqs)
{};
{}
sequences sequences_;
};

View File

@ -1,5 +1,7 @@
##==============================================================================
# Copyright (c) 2003-2006 Joel de Guzman
# Copyright (c) 2013 Mateusz Loskot
# Copyright (c) 2014-2017 Kohei Takahashi
#
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -7,6 +9,7 @@
#==============================================================================
# bring in rules for testing
import testing ;
import ../../config/checks/config : requires ;
project
: requirements
@ -15,190 +18,237 @@ project
{
test-suite fusion :
[ run algorithm/all.cpp : : : : ]
[ run algorithm/any.cpp : : : : ]
[ run algorithm/clear.cpp : : : : ]
[ run algorithm/copy.cpp : : : : ]
[ run algorithm/count.cpp : : : : ]
[ run algorithm/count_if.cpp : : : : ]
[ run algorithm/erase.cpp : : : : ]
[ run algorithm/erase_key.cpp : : : : ]
[ run algorithm/filter.cpp : : : : ]
[ run algorithm/filter_if.cpp : : : : ]
[ run algorithm/find.cpp : : : : ]
[ run algorithm/find_if.cpp : : : : ]
[ run algorithm/fold.cpp : : : : ]
[ run algorithm/for_each.cpp : : : : ]
[ run algorithm/insert.cpp : : : : ]
[ run algorithm/insert_range.cpp : : : : ]
[ run algorithm/iter_fold.cpp : : : : ]
[ run algorithm/move.cpp : : : : ]
[ run algorithm/none.cpp : : : : ]
[ run algorithm/pop_back.cpp : : : : ]
[ run algorithm/pop_front.cpp : : : : ]
[ run algorithm/push_back.cpp : : : : ]
[ run algorithm/push_front.cpp : : : : ]
[ run algorithm/remove.cpp : : : : ]
[ run algorithm/remove_if.cpp : : : : ]
[ run algorithm/replace.cpp : : : : ]
[ run algorithm/replace_if.cpp : : : : ]
[ run algorithm/reverse_fold.cpp : : : : ]
[ run algorithm/reverse_iter_fold.cpp : : : : ]
[ run algorithm/reverse.cpp : : : : ]
[ run algorithm/segmented_for_each.cpp : : : : ]
[ run algorithm/segmented_find.cpp : : : : ]
[ run algorithm/segmented_find_if.cpp : : : : ]
[ run algorithm/segmented_fold.cpp : : : : ]
[ run algorithm/transform.cpp : : : : ]
[ run algorithm/join.cpp : : : : ]
[ run algorithm/zip.cpp : : : : ]
[ run algorithm/zip2.cpp : : : : ]
[ run algorithm/zip_ignore.cpp : : : : ]
[ run algorithm/flatten.cpp : : : : ]
[ run algorithm/all.cpp ]
[ run algorithm/any.cpp ]
[ run algorithm/clear.cpp ]
[ run algorithm/copy.cpp ]
[ run algorithm/count.cpp ]
[ run algorithm/count_if.cpp ]
[ run algorithm/erase.cpp ]
[ run algorithm/erase_key.cpp ]
[ run algorithm/filter.cpp ]
[ run algorithm/filter_if.cpp ]
[ run algorithm/find.cpp ]
[ run algorithm/find_if.cpp ]
[ run algorithm/fold.cpp ]
[ run algorithm/for_each.cpp ]
[ run algorithm/insert.cpp ]
[ run algorithm/insert_range.cpp ]
[ run algorithm/iter_fold.cpp ]
[ run algorithm/move.cpp ]
[ run algorithm/none.cpp ]
[ run algorithm/pop_back.cpp ]
[ run algorithm/pop_front.cpp ]
[ run algorithm/push_back.cpp ]
[ run algorithm/push_front.cpp ]
[ run algorithm/remove.cpp ]
[ run algorithm/remove_if.cpp ]
[ run algorithm/replace.cpp ]
[ run algorithm/replace_if.cpp ]
[ run algorithm/reverse_fold.cpp ]
[ run algorithm/reverse_iter_fold.cpp ]
[ run algorithm/reverse.cpp ]
[ run algorithm/segmented_for_each.cpp ]
[ run algorithm/segmented_find.cpp ]
[ run algorithm/segmented_find_if.cpp ]
[ run algorithm/segmented_fold.cpp ]
[ run algorithm/transform.cpp ]
[ run algorithm/join.cpp ]
[ run algorithm/zip.cpp ]
[ run algorithm/zip2.cpp ]
[ run algorithm/zip_ignore.cpp ]
[ run algorithm/flatten.cpp ]
[ run sequence/as_deque.cpp : : : : ]
[ run sequence/as_list.cpp : : : : ]
[ run sequence/as_map.cpp : : : : ]
[ run sequence/as_map_assoc.cpp : : : : ]
[ run sequence/as_set.cpp : : : : ]
[ run sequence/as_vector.cpp : : : : ]
[ run sequence/boost_tuple.cpp : : : : ]
[ run sequence/boost_tuple_iterator.cpp : : : : ]
[ run sequence/cons.cpp : : : : ]
[ run sequence/convert_boost_tuple.cpp : : : : ]
[ run sequence/convert_deque.cpp : : : : ]
[ run sequence/convert_list.cpp : : : : ]
[ run sequence/convert_std_pair.cpp : : : : ]
[ run sequence/convert_std_tuple.cpp : : : : ]
[ run sequence/convert_vector.cpp : : : : ]
[ run sequence/filter_view.cpp : : : : ]
[ run sequence/hash.cpp : : : : ]
[ run sequence/io.cpp : : : : ]
[ run sequence/iterator_range.cpp : : : : ]
[ run sequence/joint_view.cpp : : : : ]
[ run sequence/list_comparison.cpp : : : : ]
[ run sequence/list_construction.cpp : : : : ]
[ run sequence/list_copy.cpp : : : : ]
[ run sequence/list_iterator.cpp : : : : ]
[ run sequence/list_hash.cpp : : : : ]
[ run sequence/list_make.cpp : : : : ]
[ run sequence/list_misc.cpp : : : : ]
[ run sequence/list_mutate.cpp : : : : ]
[ run sequence/list_nest.cpp : : : : ]
[ run sequence/list_tie.cpp : : : : ]
[ run sequence/list_value_at.cpp : : : : ]
[ run sequence/deque_comparison.cpp : : : : ]
[ run sequence/deque_construction.cpp : : : : ]
[ run sequence/deque_copy.cpp : : : : ]
[ run sequence/deque_iterator.cpp : : : : ]
[ run sequence/deque_hash.cpp : : : : ]
[ compile sequence/deque_is_constructible.cpp : : : : ]
[ run sequence/deque_make.cpp : : : : ]
[ run sequence/deque_misc.cpp : : : : ]
[ run sequence/deque_move.cpp : : : : ]
[ run sequence/deque_mutate.cpp : : : : ]
[ run sequence/deque_nest.cpp : : : : ]
[ run sequence/deque_tie.cpp : : : : ]
[ run sequence/deque_value_at.cpp : : : : ]
[ run sequence/front_extended_deque.cpp : : : : ]
[ run sequence/back_extended_deque.cpp : : : : ]
[ run sequence/make_list.cpp : : : : ]
[ run sequence/make_vector.cpp : : : : ]
[ run sequence/map.cpp : : : : ]
[ run sequence/map_comparison.cpp : : : : ]
[ run sequence/map_construction.cpp : : : : ]
[ run sequence/map_copy.cpp : : : : ]
[ run sequence/map_misc.cpp : : : : ]
[ run sequence/map_move.cpp : : : : ]
[ run sequence/map_mutate.cpp : : : : ]
[ run sequence/map_tie.cpp : : : : ]
[ run sequence/nil.cpp : : : : ]
[ run sequence/nview.cpp : : : : ]
[ run sequence/reverse_view.cpp : : : : ]
[ run sequence/segmented_iterator_range.cpp : : : : ]
[ run sequence/set.cpp : : : : ]
[ run sequence/single_view.cpp : : : : ]
[ run sequence/std_pair.cpp : : : : ]
[ run sequence/boost_array.cpp : : : : ]
[ run sequence/array.cpp : : : : ]
[ run sequence/tuple_comparison.cpp : : : : ]
[ run sequence/tuple_construction.cpp : : : : ]
[ run sequence/tuple_copy.cpp : : : : ]
[ run sequence/tuple_element.cpp : : : : ]
[ run sequence/tuple_make.cpp : : : : ]
[ run sequence/tuple_misc.cpp : : : : ]
[ run sequence/tuple_mutate.cpp : : : : ]
[ run sequence/tuple_nest.cpp : : : : ]
[ run sequence/tuple_hash.cpp : : : : ]
[ run sequence/tuple_tie.cpp : : : : ]
[ run sequence/transform_view.cpp : : : : ]
[ run sequence/vector_comparison.cpp : : : : ]
[ run sequence/vector_construction.cpp : : : : ]
[ run sequence/vector_copy.cpp : : : : ]
[ run sequence/vector_iterator.cpp : : : : ]
[ run sequence/vector_make.cpp : : : : ]
[ run sequence/vector_misc.cpp : : : : ]
[ run sequence/vector_move.cpp : : : : ]
[ run sequence/vector_mutate.cpp : : : : ]
[ run sequence/vector_n.cpp : : : : ]
[ run sequence/vector_nest.cpp : : : : ]
[ run sequence/vector_hash.cpp : : : : ]
[ run sequence/vector_tie.cpp : : : : ]
[ run sequence/vector_value_at.cpp : : : : ]
[ run sequence/zip_view.cpp : : : : ]
[ run sequence/zip_view2.cpp : : : : ]
[ run sequence/zip_view_ignore.cpp : : : : ]
[ run sequence/repetitive_view.cpp : : : : ]
[ run sequence/deduce_sequence.cpp : : : : ]
[ run sequence/adapt_adt_named.cpp : : : : ]
[ run sequence/adapt_adt.cpp : : : : ]
[ run sequence/adapt_assoc_adt_named.cpp : : : : ]
[ run sequence/adapt_assoc_adt.cpp : : : : ]
[ run sequence/adapt_assoc_struct_named.cpp : : : : ]
[ run sequence/adapt_assoc_struct.cpp : : : : ]
[ run sequence/adapt_assoc_tpl_adt.cpp : : : : ]
[ run sequence/adapt_assoc_tpl_struct.cpp : : : : ]
[ run sequence/adapt_struct_named.cpp : : : : ]
[ run sequence/adapt_struct.cpp : : : : ]
[ run sequence/adapt_tpl_adt.cpp : : : : ]
[ run sequence/adapt_tpl_struct.cpp : : : : ]
[ run sequence/adt_attribute_proxy.cpp : : : : ]
[ run sequence/define_struct.cpp : : : : ]
[ run sequence/define_struct_inline.cpp : : : : ]
[ run sequence/define_assoc_struct.cpp : : : : ]
[ run sequence/define_tpl_struct.cpp : : : : ]
[ run sequence/define_tpl_struct_inline.cpp : : : : ]
[ run sequence/define_assoc_tpl_struct.cpp : : : : ]
[ run sequence/std_tuple.cpp : : : : ]
[ run sequence/std_tuple_iterator.cpp : : : : ]
[ run sequence/ref_vector.cpp : : : : ]
[ run sequence/flatten_view.cpp : : : : ]
[ run sequence/as_deque.cpp ]
[ run sequence/as_list.cpp ]
[ run sequence/as_map.cpp ]
[ run sequence/as_map_assoc.cpp ]
[ run sequence/as_set.cpp ]
[ run sequence/as_vector.cpp ]
[ run sequence/boost_tuple.cpp ]
[ run sequence/boost_tuple_iterator.cpp ]
[ run sequence/cons.cpp ]
[ run sequence/convert_boost_tuple.cpp ]
[ run sequence/convert_deque.cpp ]
[ run sequence/convert_list.cpp ]
[ run sequence/convert_std_pair.cpp ]
[ run sequence/convert_std_tuple.cpp : :
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
[ run sequence/convert_vector.cpp ]
[ run sequence/filter_view.cpp ]
[ run sequence/hash.cpp ]
[ run sequence/io.cpp ]
[ run sequence/iterator_range.cpp ]
[ compile sequence/issue11932.cpp ]
[ run sequence/joint_view.cpp ]
[ run sequence/list_comparison.cpp ]
[ run sequence/list_construction.cpp ]
[ run sequence/list_copy.cpp ]
[ run sequence/list_iterator.cpp ]
[ run sequence/list_hash.cpp ]
[ run sequence/list_make.cpp ]
[ run sequence/list_misc.cpp ]
[ run sequence/list_mutate.cpp ]
[ run sequence/list_nest.cpp ]
[ run sequence/list_tie.cpp ]
[ run sequence/list_value_at.cpp ]
[ run sequence/deque_comparison.cpp ]
[ run sequence/deque_construction.cpp ]
[ run sequence/deque_copy.cpp ]
[ run sequence/deque_iterator.cpp ]
[ run sequence/deque_hash.cpp ]
[ compile sequence/deque_is_constructible.cpp ]
[ run sequence/deque_make.cpp ]
[ run sequence/deque_misc.cpp ]
[ run sequence/deque_move.cpp ]
[ run sequence/deque_mutate.cpp ]
[ run sequence/deque_nest.cpp ]
[ run sequence/deque_tie.cpp ]
[ run sequence/deque_value_at.cpp ]
[ run sequence/front_extended_deque.cpp ]
[ run sequence/back_extended_deque.cpp ]
[ run sequence/make_list.cpp ]
[ run sequence/make_vector.cpp ]
[ run sequence/map.cpp ]
[ run sequence/map_comparison.cpp ]
[ run sequence/map_construction.cpp ]
[ run sequence/map_copy.cpp ]
[ run sequence/map_misc.cpp ]
[ run sequence/map_move.cpp ]
[ run sequence/map_mutate.cpp ]
[ run sequence/map_nest.cpp ]
[ run sequence/map_tie.cpp ]
[ run sequence/nil.cpp ]
[ run sequence/nview.cpp ]
[ run sequence/reverse_view.cpp ]
[ run sequence/segmented_iterator_range.cpp ]
[ run sequence/set.cpp ]
[ run sequence/set_nest.cpp ]
[ run sequence/single_view.cpp ]
[ run sequence/std_pair.cpp ]
[ run sequence/boost_array.cpp ]
[ run sequence/array.cpp ]
[ run sequence/std_array.cpp : :
: [ requires cxx11_hdr_array ] ]
[ run sequence/tuple_comparison.cpp ]
[ run sequence/tuple_construction.cpp ]
[ run sequence/tuple_conversion.cpp ]
[ run sequence/tuple_copy.cpp ]
[ run sequence/tuple_element.cpp ]
[ run sequence/tuple_make.cpp ]
[ run sequence/tuple_misc.cpp ]
[ run sequence/tuple_mutate.cpp ]
[ run sequence/tuple_nest.cpp ]
[ run sequence/tuple_hash.cpp ]
[ run sequence/tuple_tie.cpp ]
[ run sequence/tuple_traits.cpp : :
:
: tuple_traits__maybe_variadic ]
[ run sequence/tuple_traits.cpp : :
: <define>BOOST_FUSION_DISABLE_VARIADIC_VECTOR
: tuple_traits__no_variadic ]
[ run sequence/transform_view.cpp ]
[ run sequence/vector_comparison.cpp ]
[ run sequence/vector_construction.cpp ]
[ run sequence/vector_conversion.cpp ]
[ run sequence/vector_copy.cpp ]
[ run sequence/vector_iterator.cpp ]
[ run sequence/vector_make.cpp ]
[ run sequence/vector_misc.cpp ]
[ run sequence/vector_move.cpp ]
[ run sequence/vector_mutate.cpp ]
[ run sequence/vector_n.cpp ]
[ run sequence/vector_nest.cpp ]
[ run sequence/vector_hash.cpp ]
[ run sequence/vector_tie.cpp ]
[ run sequence/vector_traits.cpp : :
:
: vector_traits__maybe_variadic ]
[ run sequence/vector_traits.cpp : :
: <define>BOOST_FUSION_DISABLE_VARIADIC_VECTOR
: vector_traits__no_variadic ]
[ run sequence/vector_value_at.cpp ]
[ run sequence/zip_view.cpp ]
[ run sequence/zip_view2.cpp ]
[ run sequence/zip_view_ignore.cpp ]
[ run sequence/repetitive_view.cpp ]
[ run sequence/deduce_sequence.cpp ]
[ run sequence/adapt_adt_named.cpp ]
[ run sequence/adapt_adt_named_empty.cpp ]
[ run sequence/adapt_adt.cpp ]
[ run sequence/adapt_adt_empty.cpp ]
[ run sequence/adapt_assoc_adt_named.cpp ]
[ run sequence/adapt_assoc_adt_named_empty.cpp ]
[ run sequence/adapt_assoc_adt.cpp ]
[ run sequence/adapt_assoc_adt_empty.cpp ]
[ run sequence/adapt_assoc_struct_named.cpp ]
[ run sequence/adapt_assoc_struct_named_empty.cpp ]
[ run sequence/adapt_assoc_struct.cpp ]
[ run sequence/adapt_assoc_struct_empty.cpp ]
[ run sequence/adapt_assoc_tpl_adt.cpp ]
[ run sequence/adapt_assoc_tpl_adt_empty.cpp ]
[ run sequence/adapt_assoc_tpl_struct.cpp ]
[ run sequence/adapt_assoc_tpl_struct_empty.cpp ]
[ run sequence/adapt_struct_named.cpp ]
[ run sequence/adapt_struct_named_empty.cpp ]
[ run sequence/adapt_struct.cpp ]
[ run sequence/adapt_struct_empty.cpp ]
[ run sequence/adapt_tpl_adt.cpp ]
[ run sequence/adapt_tpl_adt_empty.cpp ]
[ run sequence/adapt_tpl_struct.cpp ]
[ run sequence/adapt_tpl_struct_empty.cpp ]
[ run sequence/adt_attribute_proxy.cpp ]
[ run sequence/define_struct.cpp ]
[ run sequence/define_struct_empty.cpp ]
[ run sequence/define_struct_move.cpp ]
[ run sequence/define_struct_inline.cpp ]
[ run sequence/define_struct_inline_empty.cpp ]
[ run sequence/define_struct_inline_move.cpp ]
[ run sequence/define_assoc_struct.cpp ]
[ run sequence/define_assoc_struct_empty.cpp ]
[ run sequence/define_assoc_struct_move.cpp ]
[ run sequence/define_tpl_struct.cpp ]
[ run sequence/define_tpl_struct_empty.cpp ]
[ run sequence/define_tpl_struct_move.cpp ]
[ run sequence/define_tpl_struct_inline.cpp ]
[ run sequence/define_tpl_struct_inline_empty.cpp ]
[ run sequence/define_tpl_struct_inline_move.cpp ]
[ run sequence/define_assoc_tpl_struct.cpp ]
[ run sequence/define_assoc_tpl_struct_empty.cpp ]
[ run sequence/define_assoc_tpl_struct_move.cpp ]
[ run sequence/std_tuple.cpp : :
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
[ run sequence/std_tuple_iterator.cpp : :
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
[ run sequence/ref_vector.cpp ]
[ run sequence/flatten_view.cpp ]
[ compile sequence/size.cpp : : : : ]
[ compile sequence/size.cpp ]
[ run functional/fused.cpp : : : : ]
[ run functional/fused_function_object.cpp : : : : ]
[ run functional/fused_procedure.cpp : : : : ]
[ run functional/unfused.cpp : : : : ]
[ run functional/unfused_typed.cpp : : : : ]
[ run functional/make_fused.cpp : : : : ]
[ run functional/make_fused_function_object.cpp : : : : ]
[ run functional/make_fused_procedure.cpp : : : : ]
[ run functional/make_unfused.cpp : : : : ]
[ run functional/invoke.cpp : : : : ]
[ run functional/invoke_function_object.cpp : : : : ]
[ run functional/invoke_procedure.cpp : : : : ]
[ run sequence/swap.cpp : : : : ]
[ run functional/fused.cpp ]
[ run functional/fused_function_object.cpp ]
[ run functional/fused_procedure.cpp ]
[ run functional/unfused.cpp ]
[ run functional/unfused_typed.cpp ]
[ run functional/make_fused.cpp ]
[ run functional/make_fused_function_object.cpp ]
[ run functional/make_fused_procedure.cpp ]
[ run functional/make_unfused.cpp ]
[ run functional/invoke.cpp ]
[ run functional/invoke_function_object.cpp ]
[ run functional/invoke_procedure.cpp ]
[ run sequence/swap.cpp ]
[ compile support/pair_deque.cpp : : : : ]
[ compile support/pair_list.cpp : : : : ]
[ compile support/pair_map.cpp : : : : ]
[ compile support/pair_set.cpp : : : : ]
[ compile support/pair_vector.cpp : : : : ]
[ compile support/pair_nest.cpp : : : : ]
[ compile support/index_sequence.cpp : : : : ]
[ compile support/pair_deque.cpp ]
[ compile support/pair_list.cpp ]
[ compile support/pair_map.cpp ]
[ compile support/pair_set.cpp ]
[ compile support/pair_vector.cpp ]
[ compile support/pair_nest.cpp ]
[ compile support/index_sequence.cpp ]
[ compile support/and.cpp ]
# [ compile-fail xxx.cpp : : : : ]
# [ compile-fail xxx.cpp ]
;
}

View File

@ -9,28 +9,36 @@
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/algorithm/query/count_if.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/mpl/vector_c.hpp>
#include <functional>
template <typename F> struct bind1st;
template <template <typename> class F, typename T>
struct bind1st<F<T> > : public F<T>
{
T n;
bind1st(T n) : n(n) { }
bool operator()(T v) const { return F<T>::operator()(n, v); }
};
int
main()
{
{
boost::fusion::vector<int, short, double> t(1, 2, 3.3);
BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 2) == 1);
BOOST_TEST(boost::fusion::count_if(t, bind1st<std::equal_to<double> >(2)) == 1);
}
{
boost::fusion::vector<int, short, double> t(1, 2, 3.3);
BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 3) == 0);
BOOST_TEST(boost::fusion::count_if(t, bind1st<std::equal_to<double> >(3)) == 0);
}
{
typedef boost::mpl::vector_c<int, 1, 2, 3> mpl_vec;
// Cannot use lambda here as mpl iterators return rvalues and lambda needs lvalues
BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::less_equal<int>(), 2)) == 2);
BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::greater<int>(), 2)) == 1);
BOOST_TEST(boost::fusion::count_if(mpl_vec(), bind1st<std::greater_equal<int> >(2)) == 2);
BOOST_TEST(boost::fusion::count_if(mpl_vec(), bind1st<std::less<int> >(2)) == 1);
}
return boost::report_errors();

View File

@ -38,7 +38,7 @@ main()
{
char const* s = "Ruby";
typedef vector<int, short, double, long, char const*, float> vector_type;
vector_type t1(1, 2, 3.3, 4, s, 5.5);
vector_type t1(1, 2, 3.3, 4, s, 5.5f);
{
std::cout << replace_if(t1, gt3(), -456) << std::endl;

View File

@ -103,7 +103,8 @@ namespace ns
BOOST_FUSION_ADAPT_ADT(
ns::point,
(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))
)
@ -128,23 +129,23 @@ namespace ns
BOOST_FUSION_ADAPT_ADT(
ns::point,
(int, int, obj.get_x(), obj.set_x(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_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_y(), obj.set_y(val))
(auto, auto, obj.get_z(), obj.set_z(val))
)
# if !BOOST_WORKAROUND(__GNUC__,<4)
BOOST_FUSION_ADAPT_ADT(
ns::point_with_private_members,
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val))
(BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_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_x(), obj.set_x(val))
(auto, auto, obj.get_y(), obj.set_y(val))
(auto, auto, obj.get_z(), obj.set_z(val))
)
# endif
BOOST_FUSION_ADAPT_ADT(
ns::name,
(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
@ -185,9 +186,9 @@ main()
}
{
fusion::vector<int, float, int> v1(4, 2, 2);
fusion::vector<int, float, int> v1(4, 2.f, 2);
ns::point v2(5, 3, 3);
fusion::vector<long, double, int> v3(5, 4, 4);
fusion::vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,86 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_adt{};
BOOST_FUSION_ADAPT_ADT(empty_adt,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
empty_adt e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_adt>::type,
fusion::result_of::end<empty_adt>::type>));
}
{
fusion::vector<> v;
empty_adt e;
BOOST_TEST(v == e);
BOOST_TEST_NOT(v != e);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_adt e;
// conversion from empty_adt to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_adt to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
return boost::report_errors();
}

View File

@ -72,7 +72,7 @@ BOOST_FUSION_ADAPT_ADT_NAMED(
ns::point, point,
(int, int, obj.get_x(), obj.set_x(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
@ -115,11 +115,11 @@ main()
}
{
fusion::vector<int, float, int> v1(4, 2, 2);
fusion::vector<int, float, int> v1(4, 2.f, 2);
ns::point basep(5, 3, 3);
adapted::point v2(basep);
fusion::vector<long, double, int> v3(5, 4, 4);
fusion::vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,87 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_adt{};
BOOST_FUSION_ADAPT_ADT_NAMED(::empty_adt,empty_adt,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
empty_adt empty;
{
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
adapted::empty_adt e(empty);
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<adapted::empty_adt>::type,
fusion::result_of::end<adapted::empty_adt>::type>));
}
{
fusion::vector<> v;
adapted::empty_adt e(empty);
BOOST_TEST(v == e);
BOOST_TEST_NOT(v != e);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
adapted::empty_adt e(empty);
// conversion from empty_adt to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_adt to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
return boost::report_errors();
}

View File

@ -65,7 +65,7 @@ BOOST_FUSION_ADAPT_ASSOC_ADT(
ns::point,
(int, int, obj.get_x(), obj.set_x(val), ns::x_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
@ -105,9 +105,9 @@ main()
}
{
boost::fusion::vector<int, float, int> v1(4, 2, 2);
boost::fusion::vector<int, float, int> v1(4, 2.f, 2);
ns::point v2(5, 3, 3);
boost::fusion::vector<long, double, int> v3(5, 4, 4);
boost::fusion::vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,88 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_adt{};
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
empty_adt e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_adt>::type,
fusion::result_of::end<empty_adt>::type>));
}
{
fusion::vector<> v;
empty_adt e;
BOOST_TEST(v == e);
BOOST_TEST_NOT(e != v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_adt e;
// conversion from empty_adt to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_adt to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, int>));
return boost::report_errors();
}

View File

@ -45,12 +45,26 @@ namespace ns
};
}
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
ns::point,
point,
(int, int, obj.get_x(), obj.set_x(val), ns::x_member)
(int, int, obj.get_y(), obj.set_y(val), ns::y_member)
)
#if BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
ns::point,
point,
(obj.get_x(), obj.set_x(val), ns::x_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{};
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,)
@ -86,10 +100,10 @@ main()
}
{
boost::fusion::vector<int, float> v1(4, 2);
boost::fusion::vector<int, float> v1(4, 2.f);
ns::point basev2(5, 3);
adapted::point v2(basev2);
boost::fusion::vector<long, double> v3(5, 4);
boost::fusion::vector<long, double> v3(5, 4.);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,89 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/adt/adapt_assoc_adt_named.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_adt{};
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(::empty_adt,empty_adt,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
empty_adt empty;
{
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
adapted::empty_adt e(empty);
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<adapted::empty_adt>::type,
fusion::result_of::end<adapted::empty_adt>::type>));
}
{
fusion::vector<> v;
adapted::empty_adt e(empty);
BOOST_TEST(v == e);
BOOST_TEST_NOT(e != v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
adapted::empty_adt e(empty);
// conversion from empty_adt to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_adt to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, int>));
return boost::report_errors();
}

View File

@ -57,15 +57,15 @@ namespace ns
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point,
(x, ns::x_member)
(y, ns::y_member)
(auto, y, ns::y_member)
(int, z, ns::z_member)
)
#else // BOOST_PP_VARIADICS
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
ns::point,
(BOOST_FUSION_ADAPT_AUTO, x, ns::x_member)
(BOOST_FUSION_ADAPT_AUTO, y, ns::y_member)
(auto, x, ns::x_member)
(auto, y, ns::y_member)
(int, z, ns::z_member)
)
@ -107,9 +107,9 @@ main()
}
{
fusion::vector<int, float, int> v1(4, 2, 2);
fusion::vector<int, float, int> v1(4, 2.f, 2);
ns::point v2 = {5, 3, 3};
fusion::vector<long, double, int> v3(5, 4, 4);
fusion::vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,88 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_struct{};
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
empty_struct e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_struct>::type,
fusion::result_of::end<empty_struct>::type>));
}
{
fusion::vector<> v;
empty_struct e;
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_struct e;
// conversion from empty_struct to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_struct to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, int>));
return boost::report_errors();
}

View File

@ -31,12 +31,26 @@ namespace ns
};
}
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
ns::point,
point,
(int, x, ns::x_member)
(int, y, ns::y_member)
)
#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,
point,
(int, x, ns::x_member)
(auto, y, ns::y_member)
)
#endif
struct empty_struct {};
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,);
@ -72,11 +86,11 @@ main()
}
{
vector<int, float> v1(4, 2);
vector<int, float> v1(4, 2.f);
ns::point basev2 = {5, 3};
adapted::point v2(basev2);
vector<long, double> v3(5, 4);
vector<long, double> v3(5, 4.);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,89 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_struct{};
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(::empty_struct,empty_struct,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
empty_struct empty;
{
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
adapted::empty_struct e(empty);
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<adapted::empty_struct>::type,
fusion::result_of::end<adapted::empty_struct>::type>));
}
{
fusion::vector<> v;
adapted::empty_struct e(empty);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
adapted::empty_struct e(empty);
// conversion from empty_struct to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_struct to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, int>));
return boost::report_errors();
}

View File

@ -66,7 +66,7 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
(ns::point)(X)(Y)(Z),
(X, X, obj.get_x(), obj.set_x(val), ns::x_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
@ -119,9 +119,9 @@ main()
}
{
boost::fusion::vector<int, float, long> v1(4, 2, 2);
boost::fusion::vector<int, float, long> v1(4, 2.f, 2);
point v2(5, 3, 3);
boost::fusion::vector<long, double, long> v3(5, 4, 4);
boost::fusion::vector<long, double, long> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,89 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
template <typename T>
class empty_adt{};
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT((T), (empty_adt)(T),)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt<void> >));
empty_adt<void> e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt<void> >::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt<void> >));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_adt<void> >::type,
fusion::result_of::end<empty_adt<void> >::type>));
}
{
fusion::vector<> v;
empty_adt<void> e;
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_adt<void> e;
// conversion from empty_adt to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_adt to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt<void> >));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, int>));
return boost::report_errors();
}

View File

@ -55,7 +55,7 @@ namespace ns
(X)(Y)(Z),
(ns::point)(X)(Y)(Z),
(int, x, ns::x_member)
(Y, y, ns::y_member)
(auto, y, ns::y_member)
(z, ns::z_member)
)
@ -65,7 +65,7 @@ namespace ns
(ns::point)(X)(Y)(Z),
(int, x, ns::x_member)
(Y, y, ns::y_member)
(BOOST_FUSION_ADAPT_AUTO, z, ns::z_member)
(auto, z, ns::z_member)
)
#endif
@ -117,9 +117,9 @@ main()
}
{
vector<int, float, int> v1(4, 2, 2);
point v2 = {5, 3, 3};
vector<long, double, float> v3(5, 4, 4.13f);
vector<int, float, int> v1(4, 2.f, 2);
point v2 = {5, 3, 3.f};
vector<long, double, float> v3(5, 4., 4.13f);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);
@ -132,14 +132,14 @@ main()
{
// conversion from point to vector
point p = {5, 3, 3};
point p = {5, 3, 3.f};
vector<int, long, int> v(p);
v = p;
}
{
// conversion from point to list
point p = {5, 3, 3};
point p = {5, 3, 3.f};
list<int, long, int> l(p);
l = p;
}
@ -155,7 +155,7 @@ main()
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_at_key<point, ns::y_member>::type, int>));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_at_key<point, ns::z_member>::type, float>));
point p = {5, 3, 9};
point p = {5, 3, 9.f};
BOOST_TEST(at_key<ns::x_member>(p) == 5);
BOOST_TEST(at_key<ns::y_member>(p) == 3);

View File

@ -0,0 +1,89 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
template <typename T>
class empty_struct{};
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((T), (empty_struct)(T),)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
empty_struct<void> e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct<void> >));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_struct<void> >::type,
fusion::result_of::end<empty_struct<void> >::type>));
}
{
fusion::vector<> v;
empty_struct<void> e;
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_struct<void> e;
// conversion from empty_struct to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_struct to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, void>));
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, int>));
return boost::report_errors();
}

View File

@ -32,13 +32,17 @@
#include <iostream>
#include <string>
namespace namespaced_type {
typedef int integer;
}
namespace ns
{
struct point
{
int x;
int y;
int z;
namespaced_type::integer z;
};
#if !BOOST_WORKAROUND(__GNUC__,<4)
@ -104,7 +108,7 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT(
ns::bar,
foo_.x, // test that adapted members can actually be expressions
y
(auto , y)
)
BOOST_FUSION_ADAPT_STRUCT(
@ -119,8 +123,8 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT(
ns::point,
(int, x)
(int, y)
(BOOST_FUSION_ADAPT_AUTO, z)
(auto, y)
(namespaced_type::integer, z)
)
# if !BOOST_WORKAROUND(__GNUC__,<4)
@ -128,17 +132,18 @@ namespace ns
ns::point_with_private_attributes,
(int, x)
(int, y)
(BOOST_FUSION_ADAPT_AUTO, z)
(auto, z)
)
# endif
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(
ns::bar,
(BOOST_FUSION_ADAPT_AUTO, foo_.x) // test that adapted members can actually be expressions
(BOOST_FUSION_ADAPT_AUTO, y)
(auto, foo_.x) // test that adapted members can actually be expressions
(BOOST_FUSION_ADAPT_AUTO, y) // Mixing auto & BOOST_FUSION_ADAPT_AUTO
// to test backward compatibility
)
BOOST_FUSION_ADAPT_STRUCT(
@ -186,9 +191,9 @@ main()
}
{
vector<int, float, int> v1(4, 2, 2);
vector<int, float, int> v1(4, 2.f, 2);
point v2 = {5, 3, 3};
vector<long, double, int> v3(5, 4, 4);
vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);
@ -243,7 +248,7 @@ main()
#endif
{
fusion::vector<int, float> v1(4, 2);
fusion::vector<int, float> v1(4, 2.f);
ns::bar v2 = {{5}, 3};
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);

View File

@ -0,0 +1,86 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_struct{};
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
{
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
empty_struct e;
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<empty_struct>::type,
fusion::result_of::end<empty_struct>::type>));
}
{
fusion::vector<> v;
empty_struct e;
BOOST_TEST(v == e);
BOOST_TEST_NOT(e != v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
empty_struct e;
// conversion from empty_struct to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_struct to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
return boost::report_errors();
}

View File

@ -61,13 +61,13 @@ namespace ns
BOOST_FUSION_ADAPT_STRUCT_NAMED(
ns::point, point,
(int, x)
(int, y)
(BOOST_FUSION_ADAPT_AUTO, z)
(BOOST_FUSION_ADAPT_AUTO, y)
(auto, z)
)
// this creates a fusion view: ns1::s1
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
@ -109,11 +109,11 @@ main()
}
{
fusion::vector<int, float, int> v1(4, 2, 2);
fusion::vector<int, float, int> v1(4, 2.f, 2);
ns::point p = {5, 3, 3};
adapted::point v2(p);
fusion::vector<long, double, int> v3(5, 4, 4);
fusion::vector<long, double, int> v3(5, 4., 4);
BOOST_TEST(v1 < v2);
BOOST_TEST(v1 <= v2);
BOOST_TEST(v2 > v1);

View File

@ -0,0 +1,87 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
#include <boost/fusion/sequence/comparison/less.hpp>
#include <boost/fusion/sequence/comparison/less_equal.hpp>
#include <boost/fusion/sequence/comparison/greater.hpp>
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
#include <boost/fusion/mpl.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
class empty_struct{};
BOOST_FUSION_ADAPT_STRUCT_NAMED(::empty_struct,empty_struct,)
int
main()
{
using namespace boost::fusion;
using namespace boost;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
empty_struct empty;
{
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
adapted::empty_struct e(empty);
std::cout << e << std::endl;
BOOST_TEST(e == make_vector());
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
fusion::result_of::begin<adapted::empty_struct>::type,
fusion::result_of::end<adapted::empty_struct>::type>));
}
{
fusion::vector<> v;
adapted::empty_struct e(empty);
BOOST_TEST(v == e);
BOOST_TEST_NOT(e != v);
BOOST_TEST_NOT(v < e);
BOOST_TEST(v <= e);
BOOST_TEST_NOT(e > v);
BOOST_TEST(e >= v);
}
{
adapted::empty_struct e(empty);
// conversion from empty_struct to vector
fusion::vector<> v(e);
v = e;
// FIXME
// conversion from empty_struct to list
//fusion::list<> l(e);
//l = e;
}
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
return boost::report_errors();
}

Some files were not shown because too many files have changed in this diff Show More