diff --git a/doc/adapted.qbk b/doc/adapted.qbk index f762a049..a370e373 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -89,6 +89,35 @@ __std_pair_doc__, __tr1_tuple_pair__ [endsect] +[section std::tuple] + +This module provides adapters for `std::tuple`. Including the module header +makes `std::tuple` a fully conforming __random_access_sequence__. + +[important To be fully conforming, compiler should support C++11 Variadic Templates.] + +[heading Header] + + #include + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + std::tuple p(123, "Hola!!!", 456.f); + std::cout << __at_c__<0>(p) << std::endl; + std::cout << __at_c__<1>(p) << std::endl; + std::cout << p << std::endl; + +[heading See also] + +__std_tuple_doc__ + +[endsect] + [section mpl sequence] This module provides adapters for __mpl__ sequences. Including the module @@ -168,8 +197,8 @@ header makes `boost::tuple` a fully conforming __forward_sequence__. [heading Example] boost::tuple example_tuple(101, "hello"); - std::cout << *boost::fusion::begin(example_tuple) << '\n'; - std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n'; + std::cout << *__begin__(example_tuple) << '\n'; + std::cout << *__next__(__begin__(example_tuple)) << '\n'; [heading See also] @@ -185,10 +214,20 @@ necessary boilerplate to make an arbitrary struct a model of __random_access_sequence__. [heading Synopsis] + BOOST_FUSION_ADAPT_STRUCT( + struct_name, + member_name0, + member_name1, + member_name2, + ... + ) + + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT( struct_name, (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2) ... ) @@ -196,9 +235,13 @@ __random_access_sequence__. The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. + +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 +infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -208,7 +251,7 @@ namespace qualified name of the struct to be adapted. #include #include -[heading Example] +[heading Example: BOOST_FUSION_ADAPT_STRUCT ] namespace demo { struct employee @@ -221,8 +264,15 @@ namespace qualified name of the struct to be adapted. // demo::employee is now a Fusion sequence BOOST_FUSION_ADAPT_STRUCT( demo::employee, - (std::string, name) - (int, age)) + name, + age) + + // Without BOOST_PP_VARIADICS support : + BOOST_FUSION_ADAPT_STRUCT( + demo::employee, + (BOOST_FUSION_ADAPT_AUTO, name) + (BOOST_FUSION_ADAPT_AUTO, age) + ) [endsect] @@ -234,11 +284,21 @@ necessary boilerplate to make an arbitrary template struct a model of __random_access_sequence__. [heading Synopsis] + BOOST_FUSION_ADAPT_TPL_STRUCT( + (template_param0)(template_param1)..., + (struct_name) (specialization_param0)(specialization_param1)..., + member_name0, + member_name1 + ... + ) + + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) @@ -252,9 +312,12 @@ the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `struct_name` that is adapted as a fusion sequence. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. +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 +infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -272,6 +335,7 @@ namespace qualified name of the struct to be adapted. { Name name; Age age; + int employment_timestamp; }; } @@ -280,7 +344,16 @@ namespace qualified name of the struct to be adapted. (Name)(Age), (demo::employee) (Name)(Age), (Name, name) - (Age, age)) + (Age, age) + (BOOST_FUSION_ADAPT_AUTO, employment_timestamp)) + + // Or by infering type completely + BOOST_FUSION_ADAPT_TPL_STRUCT( + (Name)(Age), + (demo::employee) (Name)(Age), + name, + age, + employment_timestamp) [endsect] @@ -293,10 +366,31 @@ arbitrary struct a model of __random_access_sequence__. The given struct is adapted using the given name. [heading Synopsis] + BOOST_FUSION_ADAPT_STRUCT_NAMED( + struct_name, adapted_name, + member_name0, + member_name1, + member_name2, + ... + ) + + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( + struct_name, + (namespace0)(namespace1)..., + adapted_name, + member_name0, + member_name1, + member_name2, + ... + ) + + // Without BOOST_PP_VARIADICS support : + BOOST_FUSION_ADAPT_STRUCT_NAMED( struct_name, adapted_name, (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) @@ -306,9 +400,12 @@ adapted using the given name. adapted_name, (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) + + [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -321,9 +418,12 @@ If an empty namespace sequence is given (that is a macro that expands to nothing), the adapted view is placed in the global namespace. If no namespace sequence is given (i.e. `BOOST_FUSION_ADAPT_STRUCT_NAMED`), the adapted view is placed in the namespace `boost::fusion::adapted`. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. +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 +infered with Boost.TypeOf. The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -347,8 +447,14 @@ namespace qualified name of the struct to be converted. // referring to demo::employee BOOST_FUSION_ADAPT_STRUCT_NAMED( demo::employee, adapted_employee, - (std::string, name) - (int, age)) + name, + age) + + // Without BOOST_PP_VARIADICS support : + BOOST_FUSION_ADAPT_STRUCT_NAMED( + demo::employee, adapted_employee, + (BOOST_FUSION_ADAPT_AUTO, name), + (BOOST_FUSION_ADAPT_AUTO, age)) [endsect] @@ -362,8 +468,8 @@ __random_access_sequence__ and __associative_sequence__. [heading Synopsis] BOOST_FUSION_ADAPT_ASSOC_STRUCT( struct_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -371,10 +477,13 @@ __random_access_sequence__ and __associative_sequence__. The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__ and __associative_sequence__. -The sequence of `(member_typeN, member_nameN, key_typeN)` -triples declares the type, name and key type of each of the struct members +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 +infered with Boost.TypeOf. + The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -404,8 +513,14 @@ namespace qualified name of the struct to be adapted. // keys keys::name and keys::age present. BOOST_FUSION_ADAPT_ASSOC_STRUCT( demo::employee, - (std::string, name, keys::name) - (int, age, keys::age)) + (name, keys::name) + (age, keys::age)) + + // 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)) [endsect] @@ -420,8 +535,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -435,10 +550,13 @@ the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `struct_name` that is adapted as a fusion sequence. -The sequence of `(member_typeN, member_nameN, key_typeN)` -triples declares the type, name and key type of each of the struct members +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 +infered with Boost.TypeOf. + The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -467,6 +585,13 @@ namespace qualified name of the struct to be adapted. // Any instantiated demo::employee is now a Fusion sequence. // It is also an associative sequence with // keys keys::name and keys::age present. + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (Name)(Age), + (demo::employee) (Name)(Age), + (name, keys::name) + (age, keys::age)) + + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( (Name)(Age), (demo::employee) (Name)(Age), @@ -486,8 +611,8 @@ __associative_sequence__. The given struct is adapted using the given name. [heading Synopsis] BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( struct_name, adapted_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -495,8 +620,8 @@ __associative_sequence__. The given struct is adapted using the given name. struct_name, (namespace0)(namespace1)..., adapted_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -516,6 +641,9 @@ 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 +infered with Boost.TypeOf. + The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -544,8 +672,14 @@ namespace qualified name of the struct to be converted. // referring to demo::employee BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( demo::employee, adapted_employee, - (std::string, name, keys::name) - (int, age, keys::age)) + (name, keys::name) + (age, keys::age)) + + // 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)) [endsect] @@ -559,8 +693,8 @@ __random_access_sequence__. BOOST_FUSION_ADAPT_ADT( type_name, - (attribute_type0, attribute_const_type0, get_expr0, set_expr0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1) ... ) @@ -569,7 +703,7 @@ __random_access_sequence__. The above macro generates the necessary code to adapt `type_name` as a model of __random_access_sequence__. The sequence of -[^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N])] +[^([attribute_type['N], attribute_const_type['N],] get_expr['N], set_expr['N])] quadruples declares the types, const types, get-expressions and set-expressions of the elements that are part of the adapted fusion sequence. [^get_expr['N]] is the expression that is invoked to get the ['N]th element @@ -577,7 +711,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +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. [^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 @@ -635,8 +771,8 @@ namespace qualified name of the class type to be adapted. BOOST_FUSION_ADAPT_ADT( demo::employee, - (std::string const&, std::string const&, obj.get_name(), obj.set_name(val)) - (int, int, obj.get_age(), obj.set_age(val))) + (obj.get_name(), obj.set_name(val)) + (obj.get_age(), obj.set_age(val))) demo::employee e; front(e)="Edward Norton"; @@ -661,8 +797,8 @@ __random_access_sequence__. BOOST_FUSION_ADAPT_TPL_ADT( (template_param0)(template_param1)..., (type_name) (specialization_param0)(specialization_param1)..., - (attribute_type0, attribute_const_type0, get_expr0, set_expr0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1) ... ) @@ -685,7 +821,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +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. [^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 @@ -770,8 +908,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_ADT( type_name, - (attribute_type0, attribute_const_type0, get_expr0, set_expr0, key_type0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1, key_type1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0, key_type0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1, key_type1) ... ) @@ -788,7 +926,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +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. [^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 @@ -852,8 +992,8 @@ namespace qualified name of the class type to be adapted. BOOST_FUSION_ADAPT_ASSOC_ADT( demo::employee, - (std::string const&, std::string const&, obj.get_name(), obj.set_name(val), keys::name) - (int, int, obj.get_age(), obj.set_age(val), keys::age)) + (obj.get_name(), obj.set_name(val), keys::name) + (obj.get_age(), obj.set_age(val), keys::age)) demo::employee e; at_key(e)="Edward Norton"; @@ -878,8 +1018,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (template_param0)(template_param1)..., (type_name) (specialization_param0)(specialization_param1)..., - (attribute_type0, attribute_const_type0, get_expr0, set_expr0, key_type0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1, key_type1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0, key_type0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1, key_type1) ... ) @@ -894,7 +1034,7 @@ The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `type_name` that is adapted as a fusion sequence. The sequence of -[^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N], key_type['N])] +[^([attribute_type['N], attribute_const_type['N],] get_expr['N], set_expr['N], key_type['N])] 5-tuples declares the types, const types, get-expressions, set-expressions and key types of the elements that are part of the adapted fusion sequence. [^get_expr['N]] is the expression that is invoked to get the ['N]th element @@ -902,7 +1042,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +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. [^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 diff --git a/doc/container.qbk b/doc/container.qbk index 571c7f0a..270b184b 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -191,7 +191,7 @@ defined in __forward_sequence__. [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(l)` is provided for convenience and compatibility +[note `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `cons` being a __forward_sequence__ only (`at` is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is @@ -276,7 +276,7 @@ defined in __forward_sequence__. [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(l)` is provided for convenience and compatibility +[note `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `list` being a __forward_sequence__ only (__at__ is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is @@ -363,7 +363,7 @@ defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(d)` is provided for convenience, despite +[note `__at__(d)` is provided for convenience, despite `deque` being a __bidirectional_sequence__ only (`at` is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is constant (see __recursive_inline__). `deque` element access @@ -406,7 +406,7 @@ the same properties as the __deque__. [[`T`] [Element type] [ ]] ] -[blurb __note__ `Deque` can be a __deque__, a __front_extended_deque__ or a +[note `Deque` can be a __deque__, a __front_extended_deque__ or a __back_extended_deque__] [heading Model of] @@ -430,7 +430,7 @@ not defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ See __deque__ for further details.] +[note See __deque__ for further details.] [heading Example] @@ -467,7 +467,7 @@ the same properties as the __deque__. [[`T`] [Element type] [ ]] ] -[blurb __note__ `Deque` can be a __deque__, a __back_extended_deque__ or a +[note `Deque` can be a __deque__, a __back_extended_deque__ or a __back_extended_deque__] [heading Model of] @@ -491,7 +491,7 @@ not defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ See __deque__ for further details.] +[note See __deque__ for further details.] [heading Example] @@ -730,7 +730,7 @@ before including any Fusion header to change the default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -778,7 +778,7 @@ __result_of_make_cons__`::type` [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -828,7 +828,7 @@ default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -880,7 +880,7 @@ Fusion header to change the default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -932,7 +932,7 @@ default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -990,7 +990,7 @@ default. Example: [heading See also] -__note_boost_ref__, __fusion_pair__ +__note_ref_wrappers__, __fusion_pair__ [endsect] diff --git a/doc/functional.qbk b/doc/functional.qbk index 9bfdaa63..4a8e3d81 100644 --- a/doc/functional.qbk +++ b/doc/functional.qbk @@ -931,11 +931,11 @@ reference. Const qualification is preserved and propagated appropriately the target function object is const - or, in case the target function object is held by value, the adapter is const). -[blurb __note__ For Microsoft Visual C++ 7.1 (Visual Studio 2003) the detection +[note For Microsoft Visual C++ 7.1 (Visual Studio 2003) the detection of the Function Object's const qualification easily causes an internal error. Therefore the adapter is always treated as if it was const. ] -[blurb __tip__ If the type sequence passed to this template contains +[tip If the type sequence passed to this template contains non-reference elements, the element is copied only once - the call operator's signature is optimized automatically to avoid by-value parameters.] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 829979e6..81542f02 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -20,11 +20,6 @@ ] ] -[def __note__ [$images/note.png]] -[def __alert__ [$images/alert.png]] -[def __tip__ [$images/tip.png]] -[def __caution__ [$images/caution.png]] - [def __spirit__ [@http://spirit.sourceforge.net Spirit]] [def __phoenix__ [@http://www.boost.org/libs/phoenix/index.html Phoenix]] [def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]] @@ -55,6 +50,7 @@ [def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]] [def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]] [def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] +[def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]] [def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] [def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] @@ -331,7 +327,7 @@ [def __tag_dispatching__ [link fusion.notes.tag_dispatching /tag dispatching/]] [def __element_conversion__ [link fusion.notes.element_conversion /element conversion/]] [def __see_element_conversion__ [link fusion.notes.element_conversion /see element conversion/]] -[def __note_boost_ref__ [link fusion.notes.boost__ref `boost::ref`]] +[def __note_ref_wrappers__ [link fusion.notes.reference_wrappers `Reference Wrappers`]] [def __quick_start__ [link fusion.quick_start Quick Start]] [def __organization__ [link fusion.organization Organization]] diff --git a/doc/html/images/alert.png b/doc/html/images/alert.png deleted file mode 100755 index b4645bc7..00000000 Binary files a/doc/html/images/alert.png and /dev/null differ diff --git a/doc/html/images/caution.png b/doc/html/images/caution.png deleted file mode 100644 index 5b7809ca..00000000 Binary files a/doc/html/images/caution.png and /dev/null differ diff --git a/doc/html/images/home.png b/doc/html/images/home.png deleted file mode 100755 index 5584aacb..00000000 Binary files a/doc/html/images/home.png and /dev/null differ diff --git a/doc/html/images/important.png b/doc/html/images/important.png deleted file mode 100644 index 12c90f60..00000000 Binary files a/doc/html/images/important.png and /dev/null differ diff --git a/doc/html/images/next.png b/doc/html/images/next.png deleted file mode 100755 index 59800b4e..00000000 Binary files a/doc/html/images/next.png and /dev/null differ diff --git a/doc/html/images/note.png b/doc/html/images/note.png deleted file mode 100755 index 3ed047ca..00000000 Binary files a/doc/html/images/note.png and /dev/null differ diff --git a/doc/html/images/prev.png b/doc/html/images/prev.png deleted file mode 100755 index d88a40f9..00000000 Binary files a/doc/html/images/prev.png and /dev/null differ diff --git a/doc/html/images/smiley.png b/doc/html/images/smiley.png deleted file mode 100755 index 30a77f71..00000000 Binary files a/doc/html/images/smiley.png and /dev/null differ diff --git a/doc/html/images/tip.png b/doc/html/images/tip.png deleted file mode 100755 index 9f596b0b..00000000 Binary files a/doc/html/images/tip.png and /dev/null differ diff --git a/doc/html/images/up.png b/doc/html/images/up.png deleted file mode 100755 index 17d9c3ec..00000000 Binary files a/doc/html/images/up.png and /dev/null differ diff --git a/doc/html/images/warning.png b/doc/html/images/warning.png deleted file mode 100644 index 1c33db8f..00000000 Binary files a/doc/html/images/warning.png and /dev/null differ diff --git a/doc/html/index.html b/doc/html/index.html index 03b417ee..0fd880b6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -167,6 +167,7 @@
Array
std::pair
+
std::tuple
mpl sequence
boost::array
boost::tuple
diff --git a/doc/notes.qbk b/doc/notes.qbk index 0377023c..02b1437f 100644 --- a/doc/notes.qbk +++ b/doc/notes.qbk @@ -100,7 +100,7 @@ Array arguments are deduced to reference to const types. For example [footnote Note that the type of a string literal is an array of const characters, not `const char*`. To get __make_list__ to create a __list__ with an element of a non-const array type one must use the `ref` wrapper -(see __note_boost_ref__).]: +(see __note_ref_wrappers__).]: __make_list__("Donald", "Daisy") diff --git a/doc/preface.qbk b/doc/preface.qbk index 635b3bde..2fff963a 100644 --- a/doc/preface.qbk +++ b/doc/preface.qbk @@ -49,16 +49,11 @@ and traversal routines. It was an instant /AHA!/ moment. Some icons are used to mark certain topics indicative of their relevance. These icons precede some text to indicate: -[table Icons - [[Icon] [Name] [Meaning]] - [[__note__] [Note] [Information provided is auxiliary but will - give the reader a deeper insight into a specific - topic. May be skipped.]] - [[__alert__] [Alert] [Information provided is of utmost importance.]] - [[__caution__] [Caution] [A mild warning.]] - [[__tip__] [Tip] [A potentially useful and helpful piece of - information.]] -] +[note Information provided is auxiliary but will give the reader a deeper +insight into a specific topic. May be skipped.] +[important Information provided is of utmost importance.] +[caution A mild warning.] +[tip A potentially useful and helpful piece of information.] This documentation is automatically generated by Boost QuickBook documentation tool. QuickBook can be found in the __boost_tools__. diff --git a/doc/sequence.qbk b/doc/sequence.qbk index 4722124a..5957a6e1 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -255,7 +255,7 @@ any Random Access Sequence the following must be met: [[`__result_of_value_at_c__::type`] [Amortized constant time]] ] -[blurb __note__ `__result_of_at__` returns the actual type returned by +[note `__result_of_at__` returns the actual type returned by `__at__(s)`. In most cases, this is a reference. Hence, there is no way to know the exact element type using `__result_of_at__`.The element at `M` may actually be a reference to begin with. For this purpose, you can use @@ -330,7 +330,7 @@ For any Associative Sequence the following expressions must be valid: [[`__result_of_value_at_key__::type`] [Amortized constant time]] ] -[blurb __note__ `__result_of_at_key__` returns the actual type returned +[note `__result_of_at_key__` returns the actual type returned by `__at_key__(s)`. In most cases, this is a reference. Hence, there is no way to know the exact element type using `__result_of_at_key__`.The element at `K` may actually be a reference to begin with. For this purpose, diff --git a/doc/support.qbk b/doc/support.qbk index 1a473819..3e7b7a70 100644 --- a/doc/support.qbk +++ b/doc/support.qbk @@ -254,7 +254,7 @@ Metafunction to apply __element_conversion__ to the full argument type. It removes references to `const`, references to array types are kept, even if the array is `const`. Reference wrappers are removed (see -__note_boost_ref__)[footnote Since C++11, the standard reference wrappers +__note_ref_wrappers__)[footnote Since C++11, the standard reference wrappers are also removed.]. [heading Header] diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 3be25b1e..7ff6f4ee 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -13,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -22,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -32,17 +37,21 @@ #include #include #include +#include -#define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D)\ - ((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_1 -#define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D)\ - ((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_0 -#define BOOST_FUSION_ADAPT_ADT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ADT_FILLER_1_END - -#define BOOST_FUSION_ADAPT_ADT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ - BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4) +#define BOOST_FUSION_ADAPT_ADT_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_ADT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + BOOST_PP_IF(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)) #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index 12bf6aa2..49a8805d 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2007 Dan Marsden Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -35,25 +37,29 @@ #include #include #include - -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E)\ - ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E)\ - ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END +#include #define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ \ - BOOST_FUSION_ADAPT_ADT_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \ + BOOST_FUSION_ADAPT_ADT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + BOOST_PP_IF(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)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ > \ struct struct_assoc_key \ { \ - typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \ + typedef BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;\ }; #define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 3de396dd..dec17251 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -11,11 +11,18 @@ #define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_HPP #include +#include +#include + #include #include #include #include #include +#include +#include + +#include #define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \ typename detail::get_identity< \ @@ -28,8 +35,72 @@ \ boost::remove_const::type>::type +#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_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, \ + 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) \ + \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + \ + 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_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + }; + +#else +# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ + ATTRIBUTE_TUPEL_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; \ + }; + +#endif + +#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + BOOST_FUSION_DEDUCED_ATTR_TYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + typedef \ + BOOST_PP_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,) \ + deduced_attr_type::type \ + >::type type; \ + \ + typedef \ + BOOST_PP_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,) \ + deduced_attr_type::type \ + >::type const_type; + +#define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_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; + + #define BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \ + ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -39,30 +110,43 @@ , I \ > \ { \ + \ + BOOST_PP_IF(DEDUCE_TYPE, \ + BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ + BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \ + NAME_SEQ, \ + ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, \ + PREFIX, \ + TEMPLATE_PARAMS_SEQ) \ + \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static void \ boost_fusion_adapt_adt_impl_set( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \ Val const& val) \ { \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \ + PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ - static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ + static type \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ - return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ - static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + static const_type \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ - return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ }; \ \ @@ -75,9 +159,14 @@ , true \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) type; \ + typedef \ + BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + access::adt_attribute_access< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + >::const_type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ adt_attribute_proxy( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& o) \ @@ -111,9 +200,14 @@ , false \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ + typedef \ + BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + access::adt_attribute_access< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ adt_attribute_proxy( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& o) \ @@ -121,7 +215,7 @@ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ adt_attribute_proxy& \ operator=(Val const& val) \ { \ @@ -158,7 +252,13 @@ , I \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ + typedef BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + adt_attribute_proxy< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + , false \ + >::type lvalue; \ + \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ \ @@ -181,7 +281,7 @@ > \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call(Seq& obj) \ { \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp new file mode 100644 index 00000000..b9c93b7d --- /dev/null +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP + +#include + +#include + +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +#else // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ + 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), \ + ((3, (C,D,E))), \ + ((5, (A,B,C,D,E))) \ + ) + +#endif // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END + + +#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_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE)) + +#endif diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp new file mode 100644 index 00000000..09bd4014 --- /dev/null +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE) + +#if BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ADT_FILLER_1 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ADT_FILLER_0 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END +# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END + +# define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ + BOOST_PP_IF( \ + 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_FUSION_ADAPT_ADT_WRAP_ATTR( \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \ + BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \ + ), \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(__VA_ARGS__)) + +# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +# 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_VARIADIC_TO_SEQ(__VA_ARGS__))) + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D) \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \ + BOOST_FUSION_ADAPT_ADT_FILLER_1 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D) \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \ + BOOST_FUSION_ADAPT_ADT_FILLER_0 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END +# 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), \ + ((2, (C,D))), \ + ((4, (A,B,C,D))) \ + ) + +#endif // BOOST_PP_VARIADICS + +#endif diff --git a/include/boost/fusion/adapted/adt/detail/extension.hpp b/include/boost/fusion/adapted/adt/detail/extension.hpp index 63491180..c7d25895 100644 --- a/include/boost/fusion/adapted/adt/detail/extension.hpp +++ b/include/boost/fusion/adapted/adt/detail/extension.hpp @@ -17,7 +17,7 @@ #include namespace boost { namespace fusion -{ +{ namespace detail { template @@ -25,12 +25,12 @@ namespace boost { namespace fusion : remove_const::type> {}; } - + namespace extension { // Overload as_const() to unwrap adt_attribute_proxy. template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename adt_attribute_proxy::type as_const(const adt_attribute_proxy& proxy) { return proxy.get(); diff --git a/include/boost/fusion/adapted/array/at_impl.hpp b/include/boost/fusion/adapted/array/at_impl.hpp index 084fffc2..369c8e2e 100644 --- a/include/boost/fusion/adapted/array/at_impl.hpp +++ b/include/boost/fusion/adapted/array/at_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace extension add_reference::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/array/begin_impl.hpp b/include/boost/fusion/adapted/array/begin_impl.hpp index 4ffaba01..8ea5a00e 100644 --- a/include/boost/fusion/adapted/array/begin_impl.hpp +++ b/include/boost/fusion/adapted/array/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/array/deref_impl.hpp b/include/boost/fusion/adapted/array/deref_impl.hpp index a7dc7cb9..a5719c3a 100644 --- a/include/boost/fusion/adapted/array/deref_impl.hpp +++ b/include/boost/fusion/adapted/array/deref_impl.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/adapted/array/end_impl.hpp b/include/boost/fusion/adapted/array/end_impl.hpp index d36c6b81..e4ab63ce 100644 --- a/include/boost/fusion/adapted/array/end_impl.hpp +++ b/include/boost/fusion/adapted/array/end_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/boost_array/array_iterator.hpp b/include/boost/fusion/adapted/boost_array/array_iterator.hpp index 2002e2cc..ca8da0a2 100644 --- a/include/boost/fusion/adapted/boost_array/array_iterator.hpp +++ b/include/boost/fusion/adapted/boost_array/array_iterator.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion typedef mpl::int_ index; typedef Array array_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED array_iterator(Array& a) : array(a) {} @@ -57,7 +57,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const & it) { @@ -72,7 +72,7 @@ namespace boost { namespace fusion typedef typename Iterator::array_type array_type; typedef array_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -95,7 +95,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp index 15235e8e..e355d022 100644 --- a/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp @@ -14,7 +14,7 @@ #include namespace boost { namespace fusion { - + struct boost_array_tag; namespace extension @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typename Sequence::const_reference, typename Sequence::reference>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp index 5e0752c1..8481b765 100644 --- a/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp @@ -24,11 +24,11 @@ namespace boost { namespace fusion { struct begin_impl { template - struct apply + struct apply { typedef array_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp index 13ed1e3e..7574b364 100644 --- a/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp @@ -24,11 +24,11 @@ namespace boost { namespace fusion { struct end_impl { template - struct apply + struct apply { typedef array_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp index cffd4428..47a20a25 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp index 33613c20..1d5d392b 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp b/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp index fd96eabf..41e0d434 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace detail struct build_std_tuple { typedef std::tuple<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -61,14 +61,14 @@ namespace boost { namespace fusion { namespace detail typedef std::tuple type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type indexed_call(T const& first, std::tuple const& rest, indexed_tuple) { return type(first, std::get(rest)...); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, std::tuple const& rest) { @@ -91,7 +91,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp index ee079bed..96b67b11 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename gen::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp index 77048698..500b0491 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion static int const size = std::tuple_size::value; typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp index 0ae4ae77..a3421e0f 100644 --- a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp +++ b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp @@ -36,7 +36,8 @@ namespace boost { namespace fusion typename add_const::type, Index> identity; - BOOST_FUSION_GPU_ENABLED explicit std_tuple_iterator(Tuple& tuple) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit std_tuple_iterator(Tuple& tuple) : tuple(tuple) {} Tuple& tuple; @@ -58,7 +59,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& iter) { @@ -73,7 +74,7 @@ namespace boost { namespace fusion typedef typename Iterator::tuple_type tuple_type; typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -96,7 +97,7 @@ namespace boost { namespace fusion { typedef mpl::int_ type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index eca77d61..eab4e1bb 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -35,32 +36,35 @@ #include #include -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ - ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ - ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END - #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,PREFIX,ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + IS_VIEW, \ + I, \ + PREFIX, \ + 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)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ > \ struct struct_assoc_key \ { \ - typedef BOOST_PP_TUPLE_ELEM(3, 2, ATTRIBUTE) type; \ + typedef \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type; \ }; #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, I, ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE) + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,BOOST_PP_EMPTY,ATTRIBUTE) + #define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index f60ca03e..e96e7c76 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -1,6 +1,7 @@ /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -10,8 +11,12 @@ #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #include +#include #include #include +#include +#include +#include #include #include #include @@ -19,6 +24,7 @@ #include #include +#include #include #include #include @@ -30,43 +36,88 @@ #include #include -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END +#define BOOST_FUSION_ADAPT_STRUCT_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + IS_VIEW, \ + I, \ + BOOST_PP_IF(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)) -#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ - BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE,2) -#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (1)TEMPLATE_PARAMS_SEQ, \ - (1)NAME_SEQ, \ - struct_tag, \ - 0, \ - ((0,0)) BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) -#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) +#if BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 1, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) +# define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +# define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + 0, \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +# define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \ + _END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 1, \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \ + _END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + + +#endif // BOOST_PP_VARIADICS #endif diff --git a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp index 3f29f3a3..791fb5b0 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp @@ -15,26 +15,41 @@ #include #include -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0(X, Y) \ - (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1(X, Y) \ - (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1_END +#ifdef BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ +# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ...) \ \ - BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ - WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ \ - BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ - BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ - BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END)) + BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME, \ + __VA_ARGS__) -#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) +# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,__VA_ARGS__) + + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME, \ + ATTRIBUTES) + +# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif #endif diff --git a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp index 1f5ce8dc..f4a3679d 100644 --- a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp @@ -12,6 +12,13 @@ #include #include +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ + ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1 +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ + ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0 +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1_END + #define BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ \ @@ -20,7 +27,7 @@ (0)NAMESPACE_SEQ, \ NAME, \ BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ 3) \ \ BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ @@ -34,7 +41,7 @@ (0)NAMESPACE_SEQ, \ NAME, \ BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ 3) \ \ BOOST_FUSION_ADAPT_ASSOC_STRUCT( \ diff --git a/include/boost/fusion/adapted/struct/define_struct.hpp b/include/boost/fusion/adapted/struct/define_struct.hpp index fa1f549f..29785436 100644 --- a/include/boost/fusion/adapted/struct/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_struct.hpp @@ -19,7 +19,7 @@ TEMPLATE_PARAMS_SEQ, \ (0)NAMESPACE_SEQ, \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ 2) \ \ BOOST_FUSION_ADAPT_TPL_STRUCT( \ @@ -32,7 +32,7 @@ BOOST_FUSION_DEFINE_STRUCT_IMPL( \ (0)NAMESPACE_SEQ, \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ 2) \ \ BOOST_FUSION_ADAPT_STRUCT( \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp new file mode 100644 index 00000000..5178150b --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP + +#include + +#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index db702ae1..8ec467ae 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -13,6 +14,8 @@ #include #include #include +#include +#include #include #include @@ -25,12 +28,16 @@ #include #include #include +#include #include #include #include #include #include +#include + + #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ BOOST_PP_SEQ_HEAD(SEQ) \ BOOST_PP_EMPTY() @@ -55,6 +62,49 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) +#ifdef BOOST_MSVC +# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + \ + 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_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + 0, ATTRIBUTE)) \ + type; \ + }; \ + \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + deduced_attr_type::type attribute_type; + +#else +# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_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)) \ + type; \ + }; \ + \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + deduced_attr_type::type attribute_type; + +#endif + +#define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + typedef \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; + + #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ @@ -83,9 +133,10 @@ #endif #define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \ - BOOST_PP_TUPLE_ELEM(3,0,DATA)( \ - BOOST_PP_TUPLE_ELEM(3,1,DATA), \ - BOOST_PP_TUPLE_ELEM(3,2,DATA), \ + BOOST_PP_TUPLE_ELEM(4,0,DATA)( \ + BOOST_PP_TUPLE_ELEM(4,1,DATA), \ + BOOST_PP_TUPLE_ELEM(4,2,DATA), \ + BOOST_PP_TUPLE_ELEM(4,3,DATA), \ I, \ ATTRIBUTE) @@ -107,7 +158,9 @@ #endif #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \ + I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \ + DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -117,9 +170,14 @@ , I \ > \ { \ - typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ - attribute_type; \ + BOOST_PP_IF(DEDUCE_TYPE, \ + BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \ + NAME_SEQ, \ + ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, \ + PREFIX, \ + TEMPLATE_PARAMS_SEQ) \ + \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ \ @@ -138,12 +196,13 @@ >::type \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call(Seq& seq) \ { \ return seq.PREFIX() \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \ } \ }; \ }; \ @@ -158,12 +217,14 @@ { \ typedef char const* type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call() \ { \ return BOOST_PP_STRINGIZE( \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \ + ATTRIBUTE)); \ } \ }; @@ -195,7 +256,7 @@ namespace boost BOOST_PP_TUPLE_EAT(4))( \ 1, \ BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \ - (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \ + (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ, IS_VIEW),\ BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \ \ template< \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp new file mode 100644 index 00000000..c75e83c3 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP + +#include + +#include + +#include +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +#else // BOOST_PP_VARIADICS + + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ + 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), \ + ((2, (Y,Z))), \ + ((3, (X,Y,Z))) \ + ) + +#endif // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END + + +#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_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp new file mode 100644 index 00000000..69d5b204 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#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), \ + ((1, (Y))), \ + ((2, (X,Y))) \ + ) + +#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE) + + +#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_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO, \ + elem)) + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ + BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP, \ + unused, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \ + (0,0)) + +#endif // BOOST_PP_VARIADICS + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp new file mode 100644 index 00000000..2b54a2c0 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + 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_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP + +#define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp index 9cb68719..f67df3a7 100644 --- a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index 44d99f06..25542920 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -34,6 +34,13 @@ #include #include +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0(X, Y) \ + ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_1 +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1(X, Y) \ + ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_0 +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END + #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \ R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ \ @@ -62,7 +69,7 @@ ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ self_type& \ operator=(Seq const& seq) \ { \ @@ -121,7 +128,7 @@ ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTES_SEQ) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME() \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ @@ -130,7 +137,7 @@ ATTRIBUTES_SEQ) \ {} \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(self_type const& other_self) \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ @@ -140,7 +147,7 @@ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(Seq const& seq \ BOOST_PP_IF( \ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ @@ -160,7 +167,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(boost::call_traits< \ BOOST_PP_TUPLE_ELEM( \ @@ -173,7 +180,7 @@ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(typename boost::call_traits< \ typename boost::fusion::detail::get_first_arg< \ @@ -210,7 +217,7 @@ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \ @@ -238,7 +245,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \ @@ -280,12 +287,12 @@ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(Seq const&) \ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ self_type& \ operator=(Seq const& seq) \ { \ diff --git a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp index d720fcf8..a5a3ae06 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -66,6 +66,7 @@ #define BOOST_FUSION_IGNORE_2(ARG1, ARG2) #define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I( \ BOOST_FUSION_MAKE_CONST_REF_PARAM, \ ~, \ @@ -113,7 +114,7 @@ struct deref > \ { \ typedef typename boost_fusion_detail_Sq::t##N##_type TYPE_QUAL& type; \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(CALL_ARG_TYPE, N> const& iter) \ { \ return iter.seq_.BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ @@ -163,7 +164,7 @@ typename boost_fusion_detail_Sq::t##N##_type& \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return sq. BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ @@ -208,7 +209,7 @@ result_raw_type \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(iterator_raw_type const& iter) \ { \ return boost::fusion::at_c(iter.ref_vec); \ @@ -301,7 +302,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \ BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL( \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END)) // Note: can't compute BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ) directly because // ATTRIBUTES_SEQ may be empty and calling BOOST_PP_SEQ_SIZE on an empty @@ -315,7 +316,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \ BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL( \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END)) #define BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL(NAME, ATTRIBUTES_SEQ) \ BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \ @@ -336,7 +337,7 @@ typedef boost::mpl::int_ index; \ typedef boost_fusion_detail_Seq sequence_type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \ : seq_(seq) \ BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \ @@ -359,7 +360,7 @@ boost_fusion_detail_It::index::value + 1 \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -374,7 +375,7 @@ boost_fusion_detail_It::index::value - 1 \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -392,7 +393,7 @@ typename boost_fusion_detail_It1::index \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It1 const& /* it1 */, \ boost_fusion_detail_It2 const& /* it2 */) \ { \ @@ -412,7 +413,7 @@ + boost_fusion_detail_M::value \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -445,14 +446,14 @@ (NAME, ATTRIBUTES_SEQ) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(const boost_fusion_detail_Seq& rhs) \ { \ boost::fusion::copy(rhs, *this); \ } \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME& operator=(const boost_fusion_detail_Seq& rhs) \ { \ boost::fusion::copy(rhs, *this); \ @@ -465,7 +466,7 @@ typedef BOOST_FUSION_ITERATOR_NAME(NAME) \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ @@ -480,7 +481,7 @@ ATTRIBUTES_SEQ_SIZE \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ diff --git a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp index a3bc9f3e..c53b51a3 100644 --- a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp @@ -28,9 +28,8 @@ namespace boost { namespace fusion { namespace extension typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED - static - type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static type call(It const& it) { return impl::call(*it.seq); diff --git a/include/boost/fusion/adapted/struct/detail/end_impl.hpp b/include/boost/fusion/adapted/struct/detail/end_impl.hpp index b17eba71..855be7a4 100644 --- a/include/boost/fusion/adapted/struct/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/end_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp new file mode 100644 index 00000000..95f11050 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + BOOST_PP_VARIADICS version of BOOST_PP_IS_SEQ inspired from + boost/mpl/aux_/preprocessor/is_seq.hpp, original copyrights goes to : + + Copyright Paul Mensonides 2003 + Copyright Aleksey Gurtovoy 2003-2004 + + 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_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP + +#include +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_PP_IS_SEQ(seq) BOOST_PP_CAT(BOOST_FUSION_PP_IS_SEQ_, \ + BOOST_FUSION_PP_IS_SEQ_0 seq BOOST_PP_RPAREN()) + +#define BOOST_FUSION_PP_IS_SEQ_0(...) \ + BOOST_FUSION_PP_IS_SEQ_1(__VA_ARGS__ + +#define BOOST_FUSION_PP_IS_SEQ_ALWAYS_0(...) \ + 0 + +#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_0 \ + BOOST_FUSION_PP_IS_SEQ_ALWAYS_0( + +#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_1(...) \ + 1 + +#endif // BOOST_PP_VARIADICS + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp index 350137a4..b4cb55bb 100644 --- a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp +++ b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp @@ -12,6 +12,8 @@ #include #include +#define BOOST_FUSION_PROXY_PREFIX() obj. + #define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \ \ @@ -19,7 +21,7 @@ \ struct NAME \ { \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(WRAPPED_TYPE& in_obj) \ : obj(in_obj) \ {} \ diff --git a/include/boost/fusion/algorithm/auxiliary/copy.hpp b/include/boost/fusion/algorithm/auxiliary/copy.hpp index 683a5c87..ec240bae 100644 --- a/include/boost/fusion/algorithm/auxiliary/copy.hpp +++ b/include/boost/fusion/algorithm/auxiliary/copy.hpp @@ -34,14 +34,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const&, I2 const&, mpl::true_) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest, mpl::false_) { @@ -50,7 +50,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest) { @@ -71,7 +71,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::copy::type copy(Seq1 const& src, Seq2& dest) { diff --git a/include/boost/fusion/algorithm/auxiliary/move.hpp b/include/boost/fusion/algorithm/auxiliary/move.hpp index e7b9c9ae..e20acae5 100644 --- a/include/boost/fusion/algorithm/auxiliary/move.hpp +++ b/include/boost/fusion/algorithm/auxiliary/move.hpp @@ -34,14 +34,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const&, I2 const&, mpl::true_) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest, mpl::false_) { @@ -50,7 +50,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest) { @@ -71,7 +71,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::move::type move(Seq1&& src, Seq2& dest) { diff --git a/include/boost/fusion/algorithm/iteration/accumulate.hpp b/include/boost/fusion/algorithm/iteration/accumulate.hpp index 430f9eb5..fe7112e3 100644 --- a/include/boost/fusion/algorithm/iteration/accumulate.hpp +++ b/include/boost/fusion/algorithm/iteration/accumulate.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate @@ -39,9 +38,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate diff --git a/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp b/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp index 06333498..50c4d39d 100644 --- a/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp @@ -20,8 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate @@ -29,8 +29,8 @@ namespace boost { namespace fusion accumulate(Sequence& seq, State const& state, F f); template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate diff --git a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp index 81b3ab70..0bef5cec 100644 --- a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp @@ -21,14 +21,14 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_linear(First const&, Last const&, F const&, mpl::true_) { } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_linear(First const& first, Last const& last, F const& f, mpl::false_) { @@ -39,7 +39,7 @@ namespace detail template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_dispatch(Sequence& seq, F const& f, Tag) { @@ -56,7 +56,7 @@ namespace detail struct for_each_unrolled { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -77,7 +77,7 @@ namespace detail struct for_each_unrolled<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -94,7 +94,7 @@ namespace detail struct for_each_unrolled<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -108,7 +108,7 @@ namespace detail struct for_each_unrolled<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -119,14 +119,14 @@ namespace detail struct for_each_unrolled<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(It const&, F const&) { } }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_dispatch(Sequence& seq, F const& f, random_access_traversal_tag) { @@ -136,7 +136,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each(Sequence& seq, F const& f, mpl::false_) // unsegmented implementation { diff --git a/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp b/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp index 58aab114..4ff679af 100644 --- a/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp @@ -16,7 +16,7 @@ namespace boost { namespace fusion { namespace detail template struct segmented_fold_fun { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_fold_fun(Fun const& f) : fun(f) {} @@ -29,7 +29,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::fold::type type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const&, segmented_fold_fun const& fun) { return fusion::fold(seq, state, fun.fun); @@ -52,7 +52,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(State& state, Sequence& seq, Fun fun) { return fusion::segmented_fold_until(seq, state, segmented_fold_fun(fun)); diff --git a/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp b/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp index a5d6d4be..a32d9dad 100644 --- a/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { namespace detail template struct segmented_for_each_fun { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_for_each_fun(Fun const& f) : fun(f) {} @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace detail typedef void_ type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&, Context const&, segmented_for_each_fun const& fun) { fusion::for_each(seq, fun.fun); @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each(Sequence& seq, F const& f, mpl::true_) // segmented implementation { diff --git a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp index 5bf9e816..f8328e80 100644 --- a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/for_each.hpp b/include/boost/fusion/algorithm/iteration/for_each.hpp index 836f4810..a523c85e 100644 --- a/include/boost/fusion/algorithm/iteration/for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/for_each.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void @@ -40,9 +39,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void diff --git a/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp b/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp index 44a3d1da..13720ead 100644 --- a/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp @@ -20,9 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void @@ -30,9 +29,8 @@ namespace boost { namespace fusion for_each(Sequence& seq, F const& f); template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void diff --git a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp index 84aabfde..6c595cf1 100644 --- a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp index 82fad70a..42c8ac21 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp index 9f002419..21d99dee 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/query/all.hpp b/include/boost/fusion/algorithm/query/all.hpp index d30d7952..5122af58 100644 --- a/include/boost/fusion/algorithm/query/all.hpp +++ b/include/boost/fusion/algorithm/query/all.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/query/any.hpp b/include/boost/fusion/algorithm/query/any.hpp index 4ab97148..e1aad08d 100644 --- a/include/boost/fusion/algorithm/query/any.hpp +++ b/include/boost/fusion/algorithm/query/any.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/query/count.hpp b/include/boost/fusion/algorithm/query/count.hpp index a86bf4fe..61fc0569 100644 --- a/include/boost/fusion/algorithm/query/count.hpp +++ b/include/boost/fusion/algorithm/query/count.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , int diff --git a/include/boost/fusion/algorithm/query/count_if.hpp b/include/boost/fusion/algorithm/query/count_if.hpp index ac44ac64..8ef86b01 100644 --- a/include/boost/fusion/algorithm/query/count_if.hpp +++ b/include/boost/fusion/algorithm/query/count_if.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , int diff --git a/include/boost/fusion/algorithm/query/detail/all.hpp b/include/boost/fusion/algorithm/query/detail/all.hpp index 9c7b4c26..e7e1535d 100644 --- a/include/boost/fusion/algorithm/query/detail/all.hpp +++ b/include/boost/fusion/algorithm/query/detail/all.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_all(First const&, Last const&, F const&, mpl::true_) { @@ -29,12 +29,12 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_all(First const& first, Last const& last, F& f, mpl::false_) { typename result_of::deref::type x = *first; - return f(x) && + return f(x) && detail::linear_all( fusion::next(first) , last @@ -43,7 +43,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f, Tag) { @@ -60,11 +60,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it))&& f(*fusion::advance_c<2>(it)) && f(*fusion::advance_c<3>(it)) && @@ -76,11 +76,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it)) && f(*fusion::advance_c<2>(it)); } @@ -90,11 +90,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it)); } }; @@ -103,7 +103,7 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { return f(*it); @@ -114,7 +114,7 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& /*it*/, F /*f*/) { return true; @@ -122,7 +122,7 @@ namespace boost { namespace fusion { namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/any.hpp b/include/boost/fusion/algorithm/query/detail/any.hpp index 4e053683..43628eac 100644 --- a/include/boost/fusion/algorithm/query/detail/any.hpp +++ b/include/boost/fusion/algorithm/query/detail/any.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_any(First const&, Last const&, F const&, mpl::true_) { @@ -32,12 +32,12 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_any(First const& first, Last const& last, F& f, mpl::false_) { typename result_of::deref::type x = *first; - return f(x) || + return f(x) || detail::linear_any( fusion::next(first) , last @@ -46,7 +46,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f, Tag) { @@ -63,11 +63,11 @@ namespace detail struct unrolled_any { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it))|| f(*fusion::advance_c<2>(it)) || f(*fusion::advance_c<3>(it)) || @@ -79,11 +79,11 @@ namespace detail struct unrolled_any<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it)) || f(*fusion::advance_c<2>(it)); } @@ -93,11 +93,11 @@ namespace detail struct unrolled_any<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it)); } }; @@ -106,7 +106,7 @@ namespace detail struct unrolled_any<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { return f(*it); @@ -117,7 +117,7 @@ namespace detail struct unrolled_any<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const&, F) { return false; @@ -125,7 +125,7 @@ namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/count.hpp b/include/boost/fusion/algorithm/query/detail/count.hpp index 5e046f6b..86714ff7 100644 --- a/include/boost/fusion/algorithm/query/detail/count.hpp +++ b/include/boost/fusion/algorithm/query/detail/count.hpp @@ -25,10 +25,10 @@ namespace boost { namespace fusion { namespace detail // T1 is convertible to T2 or vice versa template <> - struct compare_convertible + struct compare_convertible { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(T1 const& x, T2 const& y) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail struct compare_convertible { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(T1 const&, T2 const&) { @@ -53,16 +53,16 @@ namespace boost { namespace fusion { namespace detail struct count_compare { typedef typename detail::call_param::type param; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED count_compare(param in_x) : x(in_x) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED bool - operator()(T2 const& y) + operator()(T2 const& y) const { - return + return compare_convertible< mpl::or_< is_convertible diff --git a/include/boost/fusion/algorithm/query/detail/count_if.hpp b/include/boost/fusion/algorithm/query/detail/count_if.hpp index baf9fe9f..17c67a0b 100644 --- a/include/boost/fusion/algorithm/query/detail/count_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/count_if.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int linear_count_if(First const&, Last const&, F const&, mpl::true_) { @@ -32,11 +32,11 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int linear_count_if(First const& first, Last const& last, F& f, mpl::false_) { - int n = + int n = detail::linear_count_if( fusion::next(first) , last @@ -48,7 +48,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int count_if(Sequence const& seq, F f, Tag) { @@ -65,7 +65,7 @@ namespace detail struct unrolled_count_if { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = unrolled_count_if:: @@ -96,7 +96,7 @@ namespace detail struct unrolled_count_if<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -121,7 +121,7 @@ namespace detail struct unrolled_count_if<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -142,7 +142,7 @@ namespace detail struct unrolled_count_if<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -157,7 +157,7 @@ namespace detail struct unrolled_count_if<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const&, F) { return 0; @@ -165,7 +165,7 @@ namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int count_if(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/find_if.hpp b/include/boost/fusion/algorithm/query/detail/find_if.hpp index 41baab48..b200794a 100644 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -184,7 +184,7 @@ namespace detail type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter, mpl::true_) { @@ -192,7 +192,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter, mpl::false_) { @@ -200,7 +200,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter) { @@ -209,7 +209,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type choose_call(Iterator const& iter, Tag) { @@ -217,7 +217,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type choose_call(Iterator const& iter, random_access_traversal_tag) { @@ -226,7 +226,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type iter_call(Iterator const& iter) { @@ -234,7 +234,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/algorithm/query/detail/segmented_find.hpp b/include/boost/fusion/algorithm/query/detail/segmented_find.hpp index 21c13a46..d8533afe 100644 --- a/include/boost/fusion/algorithm/query/detail/segmented_find.hpp +++ b/include/boost/fusion/algorithm/query/detail/segmented_find.hpp @@ -45,19 +45,19 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&state, Context const& context, segmented_find_fun) { return call_impl(seq, state, context, continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) { return state; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) { return fusion::make_segmented_iterator(fusion::find(seq), context); @@ -78,7 +78,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return fusion::segmented_fold_until( diff --git a/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp b/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp index 798ed085..fd527c73 100644 --- a/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp @@ -45,19 +45,19 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&state, Context const& context, segmented_find_if_fun) { return call_impl(seq, state, context, continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) { return state; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) { return fusion::make_segmented_iterator(fusion::find_if(seq), context); @@ -78,7 +78,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return fusion::segmented_fold_until( diff --git a/include/boost/fusion/algorithm/query/find.hpp b/include/boost/fusion/algorithm/query/find.hpp index 56e53c39..41c22fb3 100644 --- a/include/boost/fusion/algorithm/query/find.hpp +++ b/include/boost/fusion/algorithm/query/find.hpp @@ -47,8 +47,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find @@ -60,7 +60,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find::type const find(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/query/find_fwd.hpp b/include/boost/fusion/algorithm/query/find_fwd.hpp index a43b5eac..c4fc0a9f 100644 --- a/include/boost/fusion/algorithm/query/find_fwd.hpp +++ b/include/boost/fusion/algorithm/query/find_fwd.hpp @@ -20,8 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find @@ -29,7 +29,7 @@ namespace boost { namespace fusion find(Sequence& seq); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find::type const find(Sequence const& seq); }} diff --git a/include/boost/fusion/algorithm/query/find_if.hpp b/include/boost/fusion/algorithm/query/find_if.hpp index c9e50162..38601ebf 100644 --- a/include/boost/fusion/algorithm/query/find_if.hpp +++ b/include/boost/fusion/algorithm/query/find_if.hpp @@ -42,8 +42,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find_if @@ -55,7 +55,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find_if::type const find_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/query/find_if_fwd.hpp b/include/boost/fusion/algorithm/query/find_if_fwd.hpp index 419a68c4..5c8abd5b 100644 --- a/include/boost/fusion/algorithm/query/find_if_fwd.hpp +++ b/include/boost/fusion/algorithm/query/find_if_fwd.hpp @@ -21,8 +21,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find_if @@ -30,8 +30,8 @@ namespace boost { namespace fusion find_if(Sequence& seq); template - BOOST_FUSION_GPU_ENABLED - typename result_of::find_if::type const + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename result_of::find_if::type const find_if(Sequence const& seq); }} diff --git a/include/boost/fusion/algorithm/query/none.hpp b/include/boost/fusion/algorithm/query/none.hpp index bb554e3b..1fecdbfe 100644 --- a/include/boost/fusion/algorithm/query/none.hpp +++ b/include/boost/fusion/algorithm/query/none.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool none(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/transformation/clear.hpp b/include/boost/fusion/algorithm/transformation/clear.hpp index de643408..d2e42fe0 100644 --- a/include/boost/fusion/algorithm/transformation/clear.hpp +++ b/include/boost/fusion/algorithm/transformation/clear.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::clear::type clear(Sequence const& /*seq*/) { diff --git a/include/boost/fusion/algorithm/transformation/detail/replace.hpp b/include/boost/fusion/algorithm/transformation/detail/replace.hpp index 5a7516ba..88c4faab 100644 --- a/include/boost/fusion/algorithm/transformation/detail/replace.hpp +++ b/include/boost/fusion/algorithm/transformation/detail/replace.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U& call(U& x, T const&, T const&) { @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U call(U& x, T const& old_value, T const& new_value) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail template struct replacer { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED replacer(T const& in_old_value, T const& in_new_value) : old_value(in_old_value), new_value(in_new_value) {} @@ -59,9 +59,9 @@ namespace boost { namespace fusion { namespace detail mpl::if_, value, value const&>::type type; }; - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(U const& x) const { diff --git a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp index 5b9663b1..2ecff682 100644 --- a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp +++ b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_if_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U& call(U& x, F&, T const&) { @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_if_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U call(U& x, F& f, T const& new_value) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail template struct replacer_if { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED replacer_if(F in_f, T const& in_new_value) : f(in_f), new_value(in_new_value) {} @@ -59,9 +59,9 @@ namespace boost { namespace fusion { namespace detail mpl::if_, value, value const&>::type type; }; - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(U const& x) const { diff --git a/include/boost/fusion/algorithm/transformation/erase.hpp b/include/boost/fusion/algorithm/transformation/erase.hpp index 6ffdb4de..0f3b8a15 100644 --- a/include/boost/fusion/algorithm/transformation/erase.hpp +++ b/include/boost/fusion/algorithm/transformation/erase.hpp @@ -38,21 +38,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, mpl::false_) { return fusion::next(convert_iterator::call(first)); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, mpl::true_) { return convert_iterator::call(first); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first) { @@ -61,7 +61,7 @@ namespace boost { namespace fusion }; struct use_default; - + template struct fusion_default_help : mpl::if_< @@ -71,7 +71,7 @@ namespace boost { namespace fusion > { }; - + template < typename Sequence , typename First @@ -89,7 +89,7 @@ namespace boost { namespace fusion , typename compute_erase_last::type >::type LastType; - + typedef typename convert_iterator::type first_type; typedef typename convert_iterator::type last_type; typedef iterator_range left_type; @@ -99,8 +99,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , typename result_of::erase @@ -122,8 +122,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename result_of::erase::type + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename result_of::erase::type erase(Sequence const& seq, First const& first, Last const& last) { typedef result_of::erase result_of; diff --git a/include/boost/fusion/algorithm/transformation/erase_key.hpp b/include/boost/fusion/algorithm/transformation/erase_key.hpp index 43340047..3757f46f 100644 --- a/include/boost/fusion/algorithm/transformation/erase_key.hpp +++ b/include/boost/fusion/algorithm/transformation/erase_key.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::erase_key::type erase_key(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/filter.hpp b/include/boost/fusion/algorithm/transformation/filter.hpp index 2e290e29..2fc62720 100644 --- a/include/boost/fusion/algorithm/transformation/filter.hpp +++ b/include/boost/fusion/algorithm/transformation/filter.hpp @@ -22,9 +22,9 @@ namespace boost { namespace fusion typedef filter_view > type; }; } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::filter::type filter(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/filter_if.hpp b/include/boost/fusion/algorithm/transformation/filter_if.hpp index 1b9f0d32..ca28e0e8 100644 --- a/include/boost/fusion/algorithm/transformation/filter_if.hpp +++ b/include/boost/fusion/algorithm/transformation/filter_if.hpp @@ -20,9 +20,9 @@ namespace boost { namespace fusion typedef filter_view type; }; } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::filter_if::type filter_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/flatten.hpp b/include/boost/fusion/algorithm/transformation/flatten.hpp index 9cd81fa9..e3cfa983 100644 --- a/include/boost/fusion/algorithm/transformation/flatten.hpp +++ b/include/boost/fusion/algorithm/transformation/flatten.hpp @@ -25,13 +25,15 @@ namespace boost { namespace fusion { namespace result_of namespace boost { namespace fusion { template + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::flatten::type flatten(Sequence& view) { return flatten_view(view); } - + template + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::flatten::type flatten(Sequence const& view) { diff --git a/include/boost/fusion/algorithm/transformation/insert.hpp b/include/boost/fusion/algorithm/transformation/insert.hpp index 78590222..44e59653 100644 --- a/include/boost/fusion/algorithm/transformation/insert.hpp +++ b/include/boost/fusion/algorithm/transformation/insert.hpp @@ -41,9 +41,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::insert diff --git a/include/boost/fusion/algorithm/transformation/insert_range.hpp b/include/boost/fusion/algorithm/transformation/insert_range.hpp index 660ed17f..40e64e1f 100644 --- a/include/boost/fusion/algorithm/transformation/insert_range.hpp +++ b/include/boost/fusion/algorithm/transformation/insert_range.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::insert_range::type insert_range(Sequence const& seq, Position const& pos, Range const& range) { diff --git a/include/boost/fusion/algorithm/transformation/join.hpp b/include/boost/fusion/algorithm/transformation/join.hpp index 51af0535..8be49224 100644 --- a/include/boost/fusion/algorithm/transformation/join.hpp +++ b/include/boost/fusion/algorithm/transformation/join.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::join::type join(LhSequence const& lhs, RhSequence const& rhs) { diff --git a/include/boost/fusion/algorithm/transformation/pop_back.hpp b/include/boost/fusion/algorithm/transformation/pop_back.hpp index b20b5003..2f55fa5e 100644 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_back.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion static bool const is_last = IsLast; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pop_back_iterator(Iterator_ const& iterator_base) : base_type(iterator_base) {} @@ -42,7 +42,7 @@ namespace boost { namespace fusion { typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(BaseIterator const& i) { @@ -94,7 +94,7 @@ namespace boost { namespace fusion typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -116,7 +116,7 @@ namespace boost { namespace fusion typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -152,7 +152,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::pop_back::type pop_back(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/pop_front.hpp b/include/boost/fusion/algorithm/transformation/pop_front.hpp index 636ab12c..11b7f6ee 100644 --- a/include/boost/fusion/algorithm/transformation/pop_front.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_front.hpp @@ -20,19 +20,19 @@ namespace boost { namespace fusion template struct pop_front { - typedef + typedef iterator_range< typename next< typename begin::type >::type , typename end::type - > + > type; }; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::pop_front::type pop_front(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/push_back.hpp b/include/boost/fusion/algorithm/transformation/push_back.hpp index 484425d8..51c2569d 100644 --- a/include/boost/fusion/algorithm/transformation/push_back.hpp +++ b/include/boost/fusion/algorithm/transformation/push_back.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_back diff --git a/include/boost/fusion/algorithm/transformation/push_front.hpp b/include/boost/fusion/algorithm/transformation/push_front.hpp index bda056b1..a1b7b390 100644 --- a/include/boost/fusion/algorithm/transformation/push_front.hpp +++ b/include/boost/fusion/algorithm/transformation/push_front.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_front diff --git a/include/boost/fusion/algorithm/transformation/remove.hpp b/include/boost/fusion/algorithm/transformation/remove.hpp index 18dfd1d6..f8bebf70 100644 --- a/include/boost/fusion/algorithm/transformation/remove.hpp +++ b/include/boost/fusion/algorithm/transformation/remove.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::remove::type remove(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/remove_if.hpp b/include/boost/fusion/algorithm/transformation/remove_if.hpp index 40248839..5497e3a3 100644 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ b/include/boost/fusion/algorithm/transformation/remove_if.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::remove_if::type remove_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/replace.hpp b/include/boost/fusion/algorithm/transformation/replace.hpp index a0a9885b..4d754cc0 100644 --- a/include/boost/fusion/algorithm/transformation/replace.hpp +++ b/include/boost/fusion/algorithm/transformation/replace.hpp @@ -25,9 +25,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , typename result_of::replace::type diff --git a/include/boost/fusion/algorithm/transformation/replace_if.hpp b/include/boost/fusion/algorithm/transformation/replace_if.hpp index da3557aa..8a2bddc6 100644 --- a/include/boost/fusion/algorithm/transformation/replace_if.hpp +++ b/include/boost/fusion/algorithm/transformation/replace_if.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , typename result_of::replace_if::type diff --git a/include/boost/fusion/algorithm/transformation/reverse.hpp b/include/boost/fusion/algorithm/transformation/reverse.hpp index 384224d9..53de417a 100644 --- a/include/boost/fusion/algorithm/transformation/reverse.hpp +++ b/include/boost/fusion/algorithm/transformation/reverse.hpp @@ -24,9 +24,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , reverse_view diff --git a/include/boost/fusion/algorithm/transformation/transform.hpp b/include/boost/fusion/algorithm/transformation/transform.hpp index 94e45460..6a487ccc 100644 --- a/include/boost/fusion/algorithm/transformation/transform.hpp +++ b/include/boost/fusion/algorithm/transformation/transform.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::transform::type transform(Sequence const& seq, F f) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::transform::type transform(Sequence1 const& seq1, Sequence2 const& seq2, F f) { diff --git a/include/boost/fusion/algorithm/transformation/zip.hpp b/include/boost/fusion/algorithm/transformation/zip.hpp index 796ec9e3..e94efc81 100644 --- a/include/boost/fusion/algorithm/transformation/zip.hpp +++ b/include/boost/fusion/algorithm/transformation/zip.hpp @@ -101,7 +101,7 @@ namespace boost { namespace fusion #define FUSION_REF_PARAM(z, n, data) const T ## n& template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::zip::type zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t)) { diff --git a/include/boost/fusion/container/deque/back_extended_deque.hpp b/include/boost/fusion/container/deque/back_extended_deque.hpp index 206b9285..04b1d41f 100644 --- a/include/boost/fusion/container/deque/back_extended_deque.hpp +++ b/include/boost/fusion/container/deque/back_extended_deque.hpp @@ -8,6 +8,7 @@ #if !defined(BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209) #define BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209 +#include #include #include @@ -28,20 +29,20 @@ namespace boost { namespace fusion typedef mpl::int_<(result_of::size::value + 1)> size; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg const& val) : base(val, deque) {} #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg& val) : base(val, deque) {} #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg&& val) : base(BOOST_FUSION_FWD_ELEM(Arg, val), deque) {} diff --git a/include/boost/fusion/container/deque/convert.hpp b/include/boost/fusion/container/deque/convert.hpp index f791519d..9a4bf01a 100644 --- a/include/boost/fusion/container/deque/convert.hpp +++ b/include/boost/fusion/container/deque/convert.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence& seq) { @@ -48,7 +48,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence const& seq) { diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index ffb1277e..96919052 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -54,16 +54,16 @@ namespace boost { namespace fusion typedef mpl::false_ is_view; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const&, typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty>>::type* /*dummy*/ = 0) + , result_of::empty>>::type* /*dummy*/ = 0) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED - deque() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + deque() BOOST_NOEXCEPT {} }; template @@ -79,14 +79,14 @@ namespace boost { namespace fusion typedef mpl::int_<-1> next_down; typedef mpl::false_ is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() {} template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} @@ -94,7 +94,7 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque& seq) : base(seq) {} @@ -103,25 +103,25 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward>(seq)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward(seq)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(typename detail::call_param::type head , typename detail::call_param::type... tail) : base(detail::deque_keyed_values::construct(head, tail...)) @@ -131,7 +131,7 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Head_&& head, Tail_&&... tail) : base(detail::deque_keyed_values ::forward_(BOOST_FUSION_FWD_ELEM(Head_, head), BOOST_FUSION_FWD_ELEM(Tail_, tail)...)) @@ -140,21 +140,21 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Head_ const& head, Tail_ const&... tail) : base(detail::deque_keyed_values::construct(head, tail...)) {} #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Sequence const& seq , typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(deque const& rhs) { base::operator=(rhs); @@ -162,7 +162,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T const& rhs) { base::operator=(rhs); @@ -171,7 +171,7 @@ namespace boost { namespace fusion #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T&& rhs) { base::operator=(BOOST_FUSION_FWD_ELEM(T, rhs)); diff --git a/include/boost/fusion/container/deque/deque_iterator.hpp b/include/boost/fusion/container/deque/deque_iterator.hpp index 2b06bd8c..c2203796 100644 --- a/include/boost/fusion/container/deque/deque_iterator.hpp +++ b/include/boost/fusion/container/deque/deque_iterator.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef Seq sequence; typedef mpl::int_ index; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque_iterator(Seq& seq) : seq_(seq) {} @@ -54,7 +54,7 @@ namespace boost { namespace fusion { add_const, mpl::identity >::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -69,7 +69,7 @@ namespace boost { namespace fusion { typedef typename Iterator::sequence sequence; typedef deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -96,7 +96,7 @@ namespace boost { namespace fusion { >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/container/deque/detail/at_impl.hpp b/include/boost/fusion/container/deque/detail/at_impl.hpp index 4c5ffa94..3edf4829 100644 --- a/include/boost/fusion/container/deque/detail/at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/at_impl.hpp @@ -54,7 +54,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return seq.get(adjusted_index()); diff --git a/include/boost/fusion/container/deque/detail/begin_impl.hpp b/include/boost/fusion/container/deque/detail/begin_impl.hpp index c4eed54f..27b4f41b 100644 --- a/include/boost/fusion/container/deque/detail/begin_impl.hpp +++ b/include/boost/fusion/container/deque/detail/begin_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/deque/detail/build_deque.hpp b/include/boost/fusion/container/deque/detail/build_deque.hpp index d555c6c6..4dd990ae 100644 --- a/include/boost/fusion/container/deque/detail/build_deque.hpp +++ b/include/boost/fusion/container/deque/detail/build_deque.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace detail struct build_deque { typedef deque<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail { typedef deque type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, deque const& rest) { @@ -64,7 +64,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/deque/detail/convert_impl.hpp b/include/boost/fusion/container/deque/detail/convert_impl.hpp index f8ff5429..ba9b8477 100644 --- a/include/boost/fusion/container/deque/detail/convert_impl.hpp +++ b/include/boost/fusion/container/deque/detail/convert_impl.hpp @@ -37,7 +37,8 @@ namespace boost { namespace fusion { typedef result_of::as_deque gen; typedef typename gen::type type; - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(seq); diff --git a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp index 173a4924..e95daf3a 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp @@ -38,7 +38,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -124,7 +124,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp index 74d37faa..99cbe584 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence& seq) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence const& seq) { diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp index 7f630bbb..7c9417e5 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp @@ -79,34 +79,34 @@ namespace boost { namespace fusion { #include - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(typename detail::call_param::type t0) : base(t0, detail::nil_keyed_element()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(deque const& rhs) : base(rhs) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(deque const& rhs) { @@ -115,7 +115,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T const& rhs) { @@ -129,18 +129,18 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 , typename enable_if >::type* /*dummy*/ = 0 ) : base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(deque&& rhs) : base(std::forward(rhs)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq , typename disable_if< is_convertible, T0> @@ -148,7 +148,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) : base(std::forward>(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T&& rhs) { @@ -173,16 +173,16 @@ FUSION_HASH endif typedef mpl::false_ is_view; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const&, typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* /*dummy*/ = 0) + , result_of::empty > >::type* /*dummy*/ = 0) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED - deque() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + deque() BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp index 277811ec..eeaa29ff 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp @@ -35,7 +35,7 @@ FUSION_HASH if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) -BOOST_FUSION_GPU_ENABLED +BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param::type t)) : base(detail::deque_keyed_values::construct(BOOST_PP_ENUM_PARAMS(N, t))) {} @@ -49,13 +49,13 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) -BOOST_FUSION_GPU_ENABLED +BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& t)) : base(detail::deque_keyed_values::construct(BOOST_PP_ENUM_PARAMS(N, t))) {} template -BOOST_FUSION_GPU_ENABLED +BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t)) : base(detail::deque_keyed_values:: forward_(BOOST_PP_ENUM(N, FUSION_DEQUE_FORWARD_CTOR_FORWARD, _))) diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp index 1ee91ba2..21b49345 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp @@ -68,13 +68,13 @@ namespace boost { namespace fusion { namespace detail { typedef nil_keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct() { return type(); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_() { return type(); diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp index 8ba7eba0..87f3714b 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp @@ -34,7 +34,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param::type t)) { return type(t0, @@ -52,7 +52,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t)) { return type(BOOST_FUSION_FWD_ELEM(T_0, t0), diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp index efb2b90d..7c6df7b6 100644 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { namespace detail typedef typename deque_keyed_values_impl::type tail; typedef keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct( typename detail::call_param::type head , typename detail::call_param::type... tail) @@ -40,7 +40,7 @@ namespace boost { namespace fusion { namespace detail } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_(Head_&& head, Tail_&&... tail) { return type( @@ -59,11 +59,11 @@ namespace boost { namespace fusion { namespace detail { typedef nil_keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct() { return type(); } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_() { return type(); } #endif }; diff --git a/include/boost/fusion/container/deque/detail/end_impl.hpp b/include/boost/fusion/container/deque/detail/end_impl.hpp index 4ea344a9..8f67ff4a 100644 --- a/include/boost/fusion/container/deque/detail/end_impl.hpp +++ b/include/boost/fusion/container/deque/detail/end_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index 0137444a..24b5979d 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace detail void get(); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static nil_keyed_element from_iterator(It const&) { @@ -43,7 +43,7 @@ namespace boost { namespace fusion { namespace detail using Rest::get; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static keyed_element from_iterator(It const& it) { @@ -51,13 +51,13 @@ namespace boost { namespace fusion { namespace detail *it, base::from_iterator(fusion::next(it))); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element const& rhs) : Rest(rhs.get_base()), value_(rhs.value_) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element&& rhs) : Rest(BOOST_FUSION_FWD_ELEM(Rest, rhs.forward_base())) , value_(BOOST_FUSION_FWD_ELEM(Value, rhs.value_)) @@ -65,7 +65,7 @@ namespace boost { namespace fusion { namespace detail #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element const& rhs , typename enable_if >::type* = 0) : Rest(rhs.get_base()), value_(rhs.value_) @@ -74,39 +74,39 @@ namespace boost { namespace fusion { namespace detail #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif - BOOST_FUSION_GPU_ENABLED - Rest& get_base() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest& get_base() BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED - Rest const& get_base() const + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest const& get_base() const BOOST_NOEXCEPT { return *this; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED - Rest&& forward_base() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest&& forward_base() BOOST_NOEXCEPT { return BOOST_FUSION_FWD_ELEM(Rest, *static_cast(this)); } #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(Key) const { return value_; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(Key) { return value_; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element( typename detail::call_param::type value , Rest const& rest) @@ -114,20 +114,20 @@ namespace boost { namespace fusion { namespace detail {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(Value&& value, Rest&& rest) : Rest(BOOST_FUSION_FWD_ELEM(Rest, rest)) , value_(BOOST_FUSION_FWD_ELEM(Value, value)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element() : Rest(), value_() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element const& rhs) { base::operator=(static_cast(rhs)); // cast for msvc-7.1 @@ -135,7 +135,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element const& rhs) { base::operator=(rhs); @@ -144,7 +144,7 @@ namespace boost { namespace fusion { namespace detail } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element&& rhs) { base::operator=(std::forward(rhs)); diff --git a/include/boost/fusion/container/deque/front_extended_deque.hpp b/include/boost/fusion/container/deque/front_extended_deque.hpp index 48f1574a..ab4cdf7c 100644 --- a/include/boost/fusion/container/deque/front_extended_deque.hpp +++ b/include/boost/fusion/container/deque/front_extended_deque.hpp @@ -27,20 +27,20 @@ namespace boost { namespace fusion typedef mpl::int_<(result_of::size::value + 1)> size; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg const& val) : base(val, deque) {} #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg& val) : base(val, deque) {} #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg&& val) : base(BOOST_FUSION_FWD_ELEM(Arg, val), deque) {} diff --git a/include/boost/fusion/container/generation/cons_tie.hpp b/include/boost/fusion/container/generation/cons_tie.hpp index 5987fd5f..2058ebf5 100644 --- a/include/boost/fusion/container/generation/cons_tie.hpp +++ b/include/boost/fusion/container/generation/cons_tie.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion // $$$ do we really want a cons_tie? $$$ template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons cons_tie(Car& car) { @@ -34,7 +34,7 @@ namespace boost { namespace fusion // $$$ do we really want a cons_tie? $$$ template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons cons_tie(Car& car, Cdr const& cdr) { diff --git a/include/boost/fusion/container/generation/deque_tie.hpp b/include/boost/fusion/container/generation/deque_tie.hpp index 727d984f..8b6b9e7b 100644 --- a/include/boost/fusion/container/generation/deque_tie.hpp +++ b/include/boost/fusion/container/generation/deque_tie.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque deque_tie(T&... arg) { diff --git a/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp b/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp index eee53151..9146118e 100644 --- a/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp +++ b/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp @@ -89,7 +89,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque deque_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_make_deque.hpp b/include/boost/fusion/container/generation/detail/pp_make_deque.hpp index 6f75fa4a..5635c73c 100644 --- a/include/boost/fusion/container/generation/detail/pp_make_deque.hpp +++ b/include/boost/fusion/container/generation/detail/pp_make_deque.hpp @@ -57,7 +57,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline deque<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline deque<> make_deque() { return deque<>(); @@ -102,7 +103,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque make_deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_make_map.hpp b/include/boost/fusion/container/generation/detail/pp_make_map.hpp index aef5fe40..ad20cd4d 100644 --- a/include/boost/fusion/container/generation/detail/pp_make_map.hpp +++ b/include/boost/fusion/container/generation/detail/pp_make_map.hpp @@ -59,7 +59,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline map<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline map<> make_map() { return map<>(); @@ -116,7 +117,7 @@ namespace boost { namespace fusion BOOST_PP_ENUM_PARAMS(N, typename K) , BOOST_PP_ENUM_PARAMS(N, typename D) > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map make_map(BOOST_PP_ENUM_BINARY_PARAMS(N, D, const& arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_map_tie.hpp b/include/boost/fusion/container/generation/detail/pp_map_tie.hpp index 8fde3409..1a53c919 100644 --- a/include/boost/fusion/container/generation/detail/pp_map_tie.hpp +++ b/include/boost/fusion/container/generation/detail/pp_map_tie.hpp @@ -62,7 +62,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline map<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline map<> map_tie() { return map<>(); @@ -119,7 +120,7 @@ namespace boost { namespace fusion BOOST_PP_ENUM_PARAMS(N, typename K) , BOOST_PP_ENUM_PARAMS(N, typename D) > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map map_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, D, & arg)) { diff --git a/include/boost/fusion/container/generation/ignore.hpp b/include/boost/fusion/container/generation/ignore.hpp index 0bebade4..15ce15d4 100644 --- a/include/boost/fusion/container/generation/ignore.hpp +++ b/include/boost/fusion/container/generation/ignore.hpp @@ -17,7 +17,7 @@ namespace boost { namespace fusion struct swallow_assign { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED swallow_assign const& operator=(const T&) const { @@ -27,7 +27,7 @@ namespace boost { namespace fusion } // "ignore" allows tuple positions to be ignored when using "tie". - detail::swallow_assign const ignore = detail::swallow_assign(); + BOOST_CONSTEXPR detail::swallow_assign const ignore = detail::swallow_assign(); }} #endif diff --git a/include/boost/fusion/container/generation/list_tie.hpp b/include/boost/fusion/container/generation/list_tie.hpp index 2fa8c659..1dccb515 100644 --- a/include/boost/fusion/container/generation/list_tie.hpp +++ b/include/boost/fusion/container/generation/list_tie.hpp @@ -89,7 +89,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline list list_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/generation/make_cons.hpp b/include/boost/fusion/container/generation/make_cons.hpp index bb844ea3..616f1105 100644 --- a/include/boost/fusion/container/generation/make_cons.hpp +++ b/include/boost/fusion/container/generation/make_cons.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons::type> make_cons(Car const& car) { @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons::type, Cdr> make_cons(Car const& car, Cdr const& cdr) { diff --git a/include/boost/fusion/container/generation/make_deque.hpp b/include/boost/fusion/container/generation/make_deque.hpp index 18e41304..cb802f9a 100644 --- a/include/boost/fusion/container/generation/make_deque.hpp +++ b/include/boost/fusion/container/generation/make_deque.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque::type...> make_deque(T const&... arg) { diff --git a/include/boost/fusion/container/generation/make_list.hpp b/include/boost/fusion/container/generation/make_list.hpp index 8a9480e0..8cfc7e62 100644 --- a/include/boost/fusion/container/generation/make_list.hpp +++ b/include/boost/fusion/container/generation/make_list.hpp @@ -56,7 +56,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline list<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline list<> make_list() { return list<>(); @@ -101,7 +102,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline list make_list(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/make_map.hpp b/include/boost/fusion/container/generation/make_map.hpp index d2eb16e2..a6538f81 100644 --- a/include/boost/fusion/container/generation/make_map.hpp +++ b/include/boost/fusion/container/generation/make_map.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map< fusion::pair< Key diff --git a/include/boost/fusion/container/generation/make_set.hpp b/include/boost/fusion/container/generation/make_set.hpp index 5530ec59..0bde4a9c 100644 --- a/include/boost/fusion/container/generation/make_set.hpp +++ b/include/boost/fusion/container/generation/make_set.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) +#define FUSION_HASH # #endif namespace boost { namespace fusion @@ -57,7 +59,22 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline set<> + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH else + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#else + BOOST_CONSTEXPR +#endif +#endif + BOOST_FUSION_GPU_ENABLED + inline set<> make_set() { return set<>(); @@ -76,6 +93,7 @@ namespace boost { namespace fusion }} #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +#undef FUSION_HASH #pragma wave option(output: null) #endif @@ -103,7 +121,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline set make_set(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/make_vector.hpp b/include/boost/fusion/container/generation/make_vector.hpp index ed089869..57cd9b10 100644 --- a/include/boost/fusion/container/generation/make_vector.hpp +++ b/include/boost/fusion/container/generation/make_vector.hpp @@ -56,7 +56,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline vector0<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline vector0<> make_vector() { return vector0<>(); @@ -101,7 +102,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline BOOST_PP_CAT(vector, N) make_vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/map_tie.hpp b/include/boost/fusion/container/generation/map_tie.hpp index 4a988d42..259eee5f 100644 --- a/include/boost/fusion/container/generation/map_tie.hpp +++ b/include/boost/fusion/container/generation/map_tie.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map...> map_tie(T&... arg) { diff --git a/include/boost/fusion/container/generation/pair_tie.hpp b/include/boost/fusion/container/generation/pair_tie.hpp index b4fbc780..2ba128f5 100644 --- a/include/boost/fusion/container/generation/pair_tie.hpp +++ b/include/boost/fusion/container/generation/pair_tie.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename disable_if, typename result_of::pair_tie::type>::type pair_tie(T& t) { @@ -35,7 +35,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result_of::pair_tie::type pair_tie(T const& t) { diff --git a/include/boost/fusion/container/generation/vector_tie.hpp b/include/boost/fusion/container/generation/vector_tie.hpp index 4c62edc8..28efa3bd 100644 --- a/include/boost/fusion/container/generation/vector_tie.hpp +++ b/include/boost/fusion/container/generation/vector_tie.hpp @@ -87,7 +87,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline vector vector_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index 2654e8fb..61d8dbcf 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -25,8 +25,11 @@ #include #include #include +#include #include #include +#include +#include namespace boost { namespace fusion { @@ -46,48 +49,50 @@ namespace boost { namespace fusion typedef Car car_type; typedef Cdr cdr_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons() : car(), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit cons(typename detail::call_param::type in_car) : car(in_car), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( typename detail::call_param::type in_car , typename detail::call_param::type in_cdr) : car(in_car), cdr(in_cdr) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons const& rhs) : car(rhs.car), cdr(rhs.cdr) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons const& rhs) : car(rhs.car), cdr(rhs.cdr) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( Sequence const& seq - , typename boost::disable_if< - is_convertible // use copy to car instead + , typename boost::enable_if< + mpl::and_< + traits::is_sequence + , mpl::not_ > > // use copy to car instead >::type* /*dummy*/ = 0 ) : car(*fusion::begin(seq)) , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) : car(*iter) , cdr(fusion::next(iter), mpl::true_()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons const& rhs) { car = rhs.car; @@ -95,7 +100,7 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons const& rhs) { car = rhs.car; @@ -104,8 +109,12 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename boost::disable_if, cons&>::type + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + typename boost::enable_if< + mpl::and_< + traits::is_sequence + , mpl::not_ > > + , cons&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type Iterator; @@ -115,7 +124,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void assign_from_iter(Iterator const& iter) { car = *iter; diff --git a/include/boost/fusion/container/list/cons_iterator.hpp b/include/boost/fusion/container/list/cons_iterator.hpp index 0c3ec668..58b7fd9e 100644 --- a/include/boost/fusion/container/list/cons_iterator.hpp +++ b/include/boost/fusion/container/list/cons_iterator.hpp @@ -36,8 +36,8 @@ namespace boost { namespace fusion typename add_const::type> identity; - BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(cons_type& in_cons) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit cons_iterator(cons_type& in_cons) BOOST_NOEXCEPT : cons(in_cons) {} cons_type& cons; @@ -55,46 +55,47 @@ namespace boost { namespace fusion typedef cons_iterator_identity< add_const::type> identity; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_iterator() {} + nil_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit nil_iterator(nil_ const&) {} + explicit nil_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator > : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator const> : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/list/convert.hpp b/include/boost/fusion/container/list/convert.hpp index f34ad396..d85fafeb 100644 --- a/include/boost/fusion/container/list/convert.hpp +++ b/include/boost/fusion/container/list/convert.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename build_cons::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_list::type as_list(Sequence& seq) { @@ -49,7 +49,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_list::type as_list(Sequence const& seq) { diff --git a/include/boost/fusion/container/list/detail/at_impl.hpp b/include/boost/fusion/container/list/detail/at_impl.hpp index b7688522..ab36665c 100644 --- a/include/boost/fusion/container/list/detail/at_impl.hpp +++ b/include/boost/fusion/container/list/detail/at_impl.hpp @@ -107,7 +107,7 @@ namespace boost { namespace fusion type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cons& s, mpl::int_) { @@ -115,14 +115,14 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cons& s, mpl::int_<0>) { return s.car; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/container/list/detail/begin_impl.hpp b/include/boost/fusion/container/list/detail/begin_impl.hpp index a3022345..088b382d 100644 --- a/include/boost/fusion/container/list/detail/begin_impl.hpp +++ b/include/boost/fusion/container/list/detail/begin_impl.hpp @@ -36,8 +36,8 @@ namespace boost { namespace fusion struct apply { typedef cons_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& t) { diff --git a/include/boost/fusion/container/list/detail/build_cons.hpp b/include/boost/fusion/container/list/detail/build_cons.hpp index 0f407008..206af1f1 100644 --- a/include/boost/fusion/container/list/detail/build_cons.hpp +++ b/include/boost/fusion/container/list/detail/build_cons.hpp @@ -26,8 +26,8 @@ namespace boost { namespace fusion { namespace detail struct build_cons { typedef nil_ type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static nil_ call(First const&, Last const&) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion { namespace detail template struct build_cons { - typedef + typedef build_cons::type, Last> next_build_cons; @@ -47,7 +47,7 @@ namespace boost { namespace fusion { namespace detail , typename next_build_cons::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/list/detail/convert_impl.hpp b/include/boost/fusion/container/list/detail/convert_impl.hpp index 000280e7..ff010186 100644 --- a/include/boost/fusion/container/list/detail/convert_impl.hpp +++ b/include/boost/fusion/container/list/detail/convert_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename build_cons::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/container/list/detail/deref_impl.hpp b/include/boost/fusion/container/list/detail/deref_impl.hpp index aefffd75..3358a2a2 100644 --- a/include/boost/fusion/container/list/detail/deref_impl.hpp +++ b/include/boost/fusion/container/list/detail/deref_impl.hpp @@ -27,18 +27,18 @@ namespace boost { namespace fusion struct deref_impl { template - struct apply + struct apply { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::car_type value_type; - + typedef typename mpl::eval_if< is_const , add_reference::type> , add_reference >::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/list/detail/end_impl.hpp b/include/boost/fusion/container/list/detail/end_impl.hpp index 9220d24a..6ed05a5f 100644 --- a/include/boost/fusion/container/list/detail/end_impl.hpp +++ b/include/boost/fusion/container/list/detail/end_impl.hpp @@ -33,13 +33,13 @@ namespace boost { namespace fusion struct end_impl { template - struct apply + struct apply { typedef cons_iterator< typename mpl::if_, nil_ const, nil_>::type> type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence&) { diff --git a/include/boost/fusion/container/list/detail/equal_to_impl.hpp b/include/boost/fusion/container/list/detail/equal_to_impl.hpp index 0cbb6bef..a0fc297f 100644 --- a/include/boost/fusion/container/list/detail/equal_to_impl.hpp +++ b/include/boost/fusion/container/list/detail/equal_to_impl.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion struct equal_to_impl { template - struct apply + struct apply : is_same< typename I1::identity , typename I2::identity diff --git a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp index fe652ae6..a5c8aa66 100644 --- a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp +++ b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp @@ -34,7 +34,7 @@ /////////////////////////////////////////////////////////////////////////////// #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp index 3135382f..fbae5800 100644 --- a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp +++ b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp @@ -26,7 +26,7 @@ /////////////////////////////////////////////////////////////////////////////// #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(BOOST_PP_ENUM_BINARY_PARAMS( N, typename detail::call_param::type arg)) diff --git a/include/boost/fusion/container/list/detail/next_impl.hpp b/include/boost/fusion/container/list/detail/next_impl.hpp index 7383a963..f766458b 100644 --- a/include/boost/fusion/container/list/detail/next_impl.hpp +++ b/include/boost/fusion/container/list/detail/next_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::cdr_type cdr_type; - + typedef cons_iterator< typename mpl::eval_if< is_const @@ -44,8 +44,8 @@ namespace boost { namespace fusion , mpl::identity >::type> type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/list/detail/reverse_cons.hpp b/include/boost/fusion/container/list/detail/reverse_cons.hpp index f80e2c2d..14905180 100644 --- a/include/boost/fusion/container/list/detail/reverse_cons.hpp +++ b/include/boost/fusion/container/list/detail/reverse_cons.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion { namespace detail typedef reverse_cons > impl; typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(cons const &cons, State const &state = State()) { typedef fusion::cons cdr_type; @@ -35,7 +35,7 @@ namespace boost { namespace fusion { namespace detail { typedef State type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static State const &call(nil_ const &, State const &state = State()) { return state; diff --git a/include/boost/fusion/container/list/detail/value_at_impl.hpp b/include/boost/fusion/container/list/detail/value_at_impl.hpp index ea9a8593..8b288a12 100644 --- a/include/boost/fusion/container/list/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/list/detail/value_at_impl.hpp @@ -26,9 +26,9 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { - typedef typename + typedef typename mpl::eval_if< mpl::bool_ , mpl::identity diff --git a/include/boost/fusion/container/list/detail/value_of_impl.hpp b/include/boost/fusion/container/list/detail/value_of_impl.hpp index daabe411..9e7aa208 100644 --- a/include/boost/fusion/container/list/detail/value_of_impl.hpp +++ b/include/boost/fusion/container/list/detail/value_of_impl.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion struct value_of_impl { template - struct apply + struct apply { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::car_type type; diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp index 3b638315..5b584131 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/list.hpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) #include @@ -48,18 +50,19 @@ namespace boost { namespace fusion public: typedef typename list_to_cons::type inherited_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED list() : inherited_type() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED list(list const& rhs) : inherited_type(rhs) {} template - BOOST_FUSION_GPU_ENABLED - list(Sequence const& rhs) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + list(Sequence const& rhs + , typename boost::enable_if >::type* = 0) : inherited_type(rhs) {} // Expand a couple of forwarding constructors for arguments @@ -72,7 +75,7 @@ namespace boost { namespace fusion #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED list& operator=(list const& rhs) { @@ -80,10 +83,10 @@ namespace boost { namespace fusion return *this; } - template - BOOST_FUSION_GPU_ENABLED - list& - operator=(T const& rhs) + template + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + typename boost::enable_if, list&>::type + operator=(Sequence const& rhs) { inherited_type::operator=(rhs); return *this; diff --git a/include/boost/fusion/container/list/nil.hpp b/include/boost/fusion/container/list/nil.hpp index ef909c97..1b2c2349 100644 --- a/include/boost/fusion/container/list/nil.hpp +++ b/include/boost/fusion/container/list/nil.hpp @@ -32,16 +32,16 @@ namespace boost { namespace fusion typedef void_ cdr_type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_() {} + nil_() BOOST_NOEXCEPT {} template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) + nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - void assign_from_iter(Iterator const& /*iter*/) + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + void assign_from_iter(Iterator const& /*iter*/) BOOST_NOEXCEPT { } }; diff --git a/include/boost/fusion/container/map/convert.hpp b/include/boost/fusion/container/map/convert.hpp index d106610b..10431c84 100644 --- a/include/boost/fusion/container/map/convert.hpp +++ b/include/boost/fusion/container/map/convert.hpp @@ -17,7 +17,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename result_of::value_of::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return *it; @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::value_of_data::type data_type; typedef typename fusion::pair type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return type(deref_data(it)); @@ -69,7 +69,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence& seq) { @@ -78,7 +78,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence const& seq) { @@ -101,7 +101,7 @@ namespace boost { namespace fusion result_of::as_map::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { typedef result_of::as_map gen; diff --git a/include/boost/fusion/container/map/detail/at_impl.hpp b/include/boost/fusion/container/map/detail/at_impl.hpp index ce9d7a63..ab35870f 100644 --- a/include/boost/fusion/container/map/detail/at_impl.hpp +++ b/include/boost/fusion/container/map/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -47,7 +47,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/at_key_impl.hpp b/include/boost/fusion/container/map/detail/at_key_impl.hpp index 81ca6156..a546bd00 100644 --- a/include/boost/fusion/container/map/detail/at_key_impl.hpp +++ b/include/boost/fusion/container/map/detail/at_key_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(mpl::identity())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -48,7 +48,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(mpl::identity())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/begin_impl.hpp b/include/boost/fusion/container/map/detail/begin_impl.hpp index 9c8f4acb..65b39d1f 100644 --- a/include/boost/fusion/container/map/detail/begin_impl.hpp +++ b/include/boost/fusion/container/map/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/map/detail/build_map.hpp b/include/boost/fusion/container/map/detail/build_map.hpp index f5a6875f..d8f3f33f 100644 --- a/include/boost/fusion/container/map/detail/build_map.hpp +++ b/include/boost/fusion/container/map/detail/build_map.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { namespace detail struct build_map { typedef map<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail { typedef map type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, map const& rest) { @@ -66,7 +66,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp index 4af79522..efa836ba 100644 --- a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -127,7 +127,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp index 8a3209d7..b1044d7d 100644 --- a/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp @@ -27,14 +27,14 @@ namespace boost { namespace fusion struct at_impl { template - struct apply + struct apply { - typedef typename - mpl::at::type + typedef typename + mpl::at::type element; typedef typename detail::ref_result::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -45,12 +45,12 @@ namespace boost { namespace fusion template struct apply { - typedef typename - mpl::at::type + typedef typename + mpl::at::type element; typedef typename detail::cref_result::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp index 5fe1466e..6255ed88 100644 --- a/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/convert.hpp b/include/boost/fusion/container/map/detail/cpp03/convert.hpp index a03840ce..c5cc3bd6 100644 --- a/include/boost/fusion/container/map/detail/cpp03/convert.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/convert.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence& seq) { @@ -45,7 +45,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence const& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp index 14a821e8..3a773d74 100644 --- a/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp index 7be6fd96..ccaa2910 100644 --- a/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp index 260c5dfd..7fa01c3f 100644 --- a/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp index 33940c7a..2830b955 100644 --- a/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/map.hpp b/include/boost/fusion/container/map/detail/cpp03/map.hpp index 77227aae..e2f471b5 100644 --- a/include/boost/fusion/container/map/detail/cpp03/map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/map.hpp @@ -76,7 +76,7 @@ namespace boost { namespace fusion typedef typename storage_type::size size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map() : data() {} @@ -85,21 +85,21 @@ namespace boost { namespace fusion : data(rhs.data) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence const& rhs) : data(rhs) {} #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(T const& rhs) { data = rhs; return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map const& rhs) { data = rhs.data; @@ -111,19 +111,19 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(map&& rhs) : data(std::move(rhs.data)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(T&& rhs) { data = BOOST_FUSION_FWD_ELEM(T, rhs); return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map&& rhs) { data = std::move(rhs.data); @@ -134,9 +134,9 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) FUSION_HASH endif #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type& get_data() { return data; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type const& get_data() const { return data; } private: diff --git a/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp b/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp index f69e5ee6..18864e87 100644 --- a/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp @@ -26,7 +26,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp index d61ab203..2af55396 100644 --- a/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { typedef typename mpl::at::type type; }; diff --git a/include/boost/fusion/container/map/detail/end_impl.hpp b/include/boost/fusion/container/map/detail/end_impl.hpp index fea45db3..50dec8ef 100644 --- a/include/boost/fusion/container/map/detail/end_impl.hpp +++ b/include/boost/fusion/container/map/detail/end_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/map/detail/map_impl.hpp b/include/boost/fusion/container/map/detail/map_impl.hpp index 4b4baadb..c62145ba 100644 --- a/include/boost/fusion/container/map/detail/map_impl.hpp +++ b/include/boost/fusion/container/map/detail/map_impl.hpp @@ -33,24 +33,24 @@ namespace boost { namespace fusion { namespace detail static int const index = index_; static int const size = 0; - BOOST_FUSION_GPU_ENABLED - map_impl() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + map_impl() BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - map_impl(Iterator const&, map_impl_from_iterator) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + map_impl(Iterator const&, map_impl_from_iterator) BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - void assign(Iterator const&, map_impl_from_iterator) + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + void assign(Iterator const&, map_impl_from_iterator) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get(); - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get_val(); - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get_key(); }; @@ -71,54 +71,54 @@ namespace boost { namespace fusion { namespace detail typedef typename Pair::first_type key_type; typedef typename Pair::second_type value_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl() : rest_type(), element() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl const& rhs) : rest_type(rhs.get_base()), element(rhs.element) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl&& rhs) : rest_type(BOOST_FUSION_FWD_ELEM(rest_type, *static_cast(&rhs))) , element(BOOST_FUSION_FWD_ELEM(Pair, rhs.element)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl const& rhs) : rest_type(rhs.get_base()), element(rhs.element) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(typename detail::call_param::type element_ , typename detail::call_param::type... rest) : rest_type(rest...), element(element_) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(Pair&& element_, T&&... rest) : rest_type(BOOST_FUSION_FWD_ELEM(T, rest)...) , element(BOOST_FUSION_FWD_ELEM(Pair, element_)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(Iterator const& iter, map_impl_from_iterator fi) : rest_type(fusion::next(iter), fi) , element(*iter) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED rest_type& get_base() { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED rest_type const& get_base() const { return *this; @@ -138,28 +138,28 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_GPU_ENABLED mpl::identity get_key(mpl::int_) const; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(mpl::identity) const { return element.second; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(mpl::identity) { return element.second; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(mpl::int_) const { return element; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(mpl::int_) { @@ -167,7 +167,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl const& rhs) { rest_type::operator=(rhs); @@ -175,7 +175,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl const& rhs) { rest_type::operator=(rhs); @@ -183,7 +183,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl&& rhs) { rest_type::operator=(std::forward(rhs)); @@ -192,7 +192,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void assign(Iterator const& iter, map_impl_from_iterator fi) { rest_type::assign(fusion::next(iter), fi); diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index 1d308e96..f93a693f 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -52,60 +52,60 @@ namespace boost { namespace fusion typedef mpl::int_ size; typedef mpl::false_ is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(map const& seq) : base_type(seq.base()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(map&& seq) : base_type(std::forward(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence const& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence&& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(First const& first, T_ const&... rest) : base_type(first, rest...) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(First&& first, T_&&... rest) : base_type(BOOST_FUSION_FWD_ELEM(First, first), BOOST_FUSION_FWD_ELEM(T_, rest)...) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map const& rhs) { base_type::operator=(rhs.base()); return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map&& rhs) { base_type::operator=(std::forward(rhs.base())); @@ -113,7 +113,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename enable_if, map&>::type operator=(Sequence const& seq) { @@ -121,10 +121,10 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED - base_type& base() { return *this; } - BOOST_FUSION_GPU_ENABLED - base_type const& base() const { return *this; } + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + base_type& base() BOOST_NOEXCEPT { return *this; } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + base_type const& base() const BOOST_NOEXCEPT { return *this; } }; }} diff --git a/include/boost/fusion/container/map/map_iterator.hpp b/include/boost/fusion/container/map/map_iterator.hpp index b79dd1da..b229cf55 100644 --- a/include/boost/fusion/container/map/map_iterator.hpp +++ b/include/boost/fusion/container/map/map_iterator.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef Seq sequence; typedef mpl::int_ index; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_iterator(Seq& seq) : seq_(seq) {} @@ -73,7 +73,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -99,7 +99,7 @@ namespace boost { namespace fusion typedef typename add_reference::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -114,7 +114,7 @@ namespace boost { namespace fusion typedef typename Iterator::sequence sequence; typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -141,7 +141,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/container/set/convert.hpp b/include/boost/fusion/container/set/convert.hpp index 631c251d..81e064cd 100644 --- a/include/boost/fusion/container/set/convert.hpp +++ b/include/boost/fusion/container/set/convert.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_set::type as_set(Sequence& seq) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_set::type as_set(Sequence const& seq) { diff --git a/include/boost/fusion/container/set/detail/as_set.hpp b/include/boost/fusion/container/set/detail/as_set.hpp index a1e8cb7b..a41498a3 100644 --- a/include/boost/fusion/container/set/detail/as_set.hpp +++ b/include/boost/fusion/container/set/detail/as_set.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -123,7 +123,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/set/detail/begin_impl.hpp b/include/boost/fusion/container/set/detail/begin_impl.hpp index df522b57..1ebd4e46 100644 --- a/include/boost/fusion/container/set/detail/begin_impl.hpp +++ b/include/boost/fusion/container/set/detail/begin_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/set/detail/convert_impl.hpp b/include/boost/fusion/container/set/detail/convert_impl.hpp index 4a24dff8..d9d5dcfc 100644 --- a/include/boost/fusion/container/set/detail/convert_impl.hpp +++ b/include/boost/fusion/container/set/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/set/detail/deref_impl.hpp b/include/boost/fusion/container/set/detail/deref_impl.hpp index 4a43819d..e5da5219 100644 --- a/include/boost/fusion/container/set/detail/deref_impl.hpp +++ b/include/boost/fusion/container/set/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/set/detail/end_impl.hpp b/include/boost/fusion/container/set/detail/end_impl.hpp index b793addc..fbae9b75 100644 --- a/include/boost/fusion/container/set/detail/end_impl.hpp +++ b/include/boost/fusion/container/set/detail/end_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp index 460de434..5d396104 100644 --- a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp +++ b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp @@ -27,7 +27,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index e1d019a7..65a080b0 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -8,6 +8,7 @@ #define FUSION_SET_09162005_1104 #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) #include @@ -63,19 +65,20 @@ namespace boost { namespace fusion typedef typename storage_type::size size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set() : data() {} template - BOOST_FUSION_GPU_ENABLED - set(Sequence const& rhs) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + set(Sequence const& rhs + , typename boost::enable_if >::type* = 0) : data(rhs) {} #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED set& operator=(T const& rhs) { @@ -83,9 +86,9 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type& get_data() { return data; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type const& get_data() const { return data; } private: diff --git a/include/boost/fusion/container/vector/convert.hpp b/include/boost/fusion/container/vector/convert.hpp index 0582fe5c..adc7f478 100644 --- a/include/boost/fusion/container/vector/convert.hpp +++ b/include/boost/fusion/container/vector/convert.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_vector::type as_vector(Sequence& seq) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_vector::type as_vector(Sequence const& seq) { diff --git a/include/boost/fusion/container/vector/detail/advance_impl.hpp b/include/boost/fusion/container/vector/detail/advance_impl.hpp index af45a1a8..3bf26a59 100644 --- a/include/boost/fusion/container/vector/detail/advance_impl.hpp +++ b/include/boost/fusion/container/vector/detail/advance_impl.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { template struct advance_impl; - + template <> struct advance_impl { @@ -28,8 +28,8 @@ namespace boost { namespace fusion typedef typename Iterator::index index; typedef typename Iterator::vector vector; typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/as_vector.hpp b/include/boost/fusion/container/vector/detail/as_vector.hpp index 368557d0..b5f5e2d0 100644 --- a/include/boost/fusion/container/vector/detail/as_vector.hpp +++ b/include/boost/fusion/container/vector/detail/as_vector.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -123,7 +123,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/vector/detail/at_impl.hpp b/include/boost/fusion/container/vector/detail/at_impl.hpp index eb09b212..cb98dd4a 100644 --- a/include/boost/fusion/container/vector/detail/at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename mpl::at::type element; typedef typename detail::ref_result::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { @@ -46,7 +46,7 @@ namespace boost { namespace fusion typedef typename mpl::at::type element; typedef typename detail::cref_result::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& v) { diff --git a/include/boost/fusion/container/vector/detail/begin_impl.hpp b/include/boost/fusion/container/vector/detail/begin_impl.hpp index 026b34ff..ef24cd74 100644 --- a/include/boost/fusion/container/vector/detail/begin_impl.hpp +++ b/include/boost/fusion/container/vector/detail/begin_impl.hpp @@ -23,11 +23,11 @@ namespace boost { namespace fusion struct begin_impl { template - struct apply + struct apply { typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/container/vector/detail/convert_impl.hpp b/include/boost/fusion/container/vector/detail/convert_impl.hpp index ddf42590..63bfb7c7 100644 --- a/include/boost/fusion/container/vector/detail/convert_impl.hpp +++ b/include/boost/fusion/container/vector/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/vector/detail/deref_impl.hpp b/include/boost/fusion/container/vector/detail/deref_impl.hpp index b338d2fe..5186aa10 100644 --- a/include/boost/fusion/container/vector/detail/deref_impl.hpp +++ b/include/boost/fusion/container/vector/detail/deref_impl.hpp @@ -26,14 +26,14 @@ namespace boost { namespace fusion struct deref_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef typename mpl::at< typename vector::types, index>::type element; - + typedef typename mpl::if_< is_const @@ -42,7 +42,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/distance_impl.hpp b/include/boost/fusion/container/vector/detail/distance_impl.hpp index 94835538..4c2a1226 100644 --- a/include/boost/fusion/container/vector/detail/distance_impl.hpp +++ b/include/boost/fusion/container/vector/detail/distance_impl.hpp @@ -24,8 +24,8 @@ namespace boost { namespace fusion { template struct apply : mpl::minus - { - BOOST_FUSION_GPU_ENABLED + { + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename mpl::minus< typename Last::index, typename First::index>::type call(First const&, Last const&) diff --git a/include/boost/fusion/container/vector/detail/end_impl.hpp b/include/boost/fusion/container/vector/detail/end_impl.hpp index 14c67157..a77ef644 100644 --- a/include/boost/fusion/container/vector/detail/end_impl.hpp +++ b/include/boost/fusion/container/vector/detail/end_impl.hpp @@ -23,12 +23,12 @@ namespace boost { namespace fusion struct end_impl { template - struct apply + struct apply { typedef typename Sequence::size size; typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp index 50420cc8..18b3e4a3 100644 --- a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp +++ b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion struct equal_to_impl { template - struct apply + struct apply : is_same< typename I1::identity , typename I2::identity diff --git a/include/boost/fusion/container/vector/detail/next_impl.hpp b/include/boost/fusion/container/vector/detail/next_impl.hpp index 78aef85d..28408205 100644 --- a/include/boost/fusion/container/vector/detail/next_impl.hpp +++ b/include/boost/fusion/container/vector/detail/next_impl.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion struct next_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef vector_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/prior_impl.hpp b/include/boost/fusion/container/vector/detail/prior_impl.hpp index b3bdc55f..4d040d39 100644 --- a/include/boost/fusion/container/vector/detail/prior_impl.hpp +++ b/include/boost/fusion/container/vector/detail/prior_impl.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion struct prior_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef vector_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/container/vector/detail/value_at_impl.hpp index 9b94e9de..06402b43 100644 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { typedef typename mpl::at::type type; }; diff --git a/include/boost/fusion/container/vector/detail/value_of_impl.hpp b/include/boost/fusion/container/vector/detail/value_of_impl.hpp index 7527d581..2a8acf91 100644 --- a/include/boost/fusion/container/vector/detail/value_of_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_of_impl.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion struct value_of_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; diff --git a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp index ff8aaccd..8ec63607 100644 --- a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp +++ b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp @@ -26,6 +26,16 @@ #define M BOOST_PP_ITERATION() + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if M == 1 explicit @@ -40,6 +50,16 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) template + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if M == 1 explicit diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp index 2196e7f2..932ce36c 100644 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -41,9 +41,11 @@ BOOST_PP_CAT(T, n)>(vec.BOOST_PP_CAT(m, n)); #define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _) \ - BOOST_FUSION_GPU_ENABLED typename add_reference::type \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ + typename add_reference::type \ at_impl(mpl::int_) { return this->m##n; } \ - BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ + typename add_reference::type>::type \ at_impl(mpl::int_) const { return this->m##n; } #define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _) \ @@ -59,7 +61,7 @@ template struct BOOST_PP_CAT(vector_data, N) { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)() : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_DEFAULT_INIT, _) {} @@ -69,11 +71,22 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg) , typename boost::enable_if >::type* /*dummy*/ = 0 ) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_ARG_FWD, arg) {} + + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N)&& other) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_FORWARD, arg) {} @@ -82,18 +95,27 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) FUSION_HASH endif #endif +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_ENUM_BINARY_PARAMS( N, typename detail::call_param::type arg)) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_INIT, arg) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N) const& other) : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_CTOR_INIT, _) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)& operator=(BOOST_PP_CAT(vector_data, N) const& vec) { @@ -102,6 +124,15 @@ FUSION_HASH endif } template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence const& seq) @@ -113,6 +144,15 @@ FUSION_HASH endif } template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence& seq) @@ -140,9 +180,18 @@ FUSION_HASH endif typedef random_access_traversal_tag category; typedef mpl::int_ size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)() {} +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if (N == 1) explicit @@ -158,6 +207,15 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if (N == 1) explicit @@ -170,15 +228,15 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) : base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, arg)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs) : base_type(std::forward(rhs)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) const& rhs) : base_type(static_cast(rhs)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N) const& vec) { @@ -186,7 +244,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N)&& vec) { @@ -199,15 +257,34 @@ FUSION_HASH endif #endif template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( BOOST_PP_CAT(vector, N) const& vec) : base_type(BOOST_PP_ENUM_PARAMS(N, vec.m)) {} template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence const& seq + , typename boost::enable_if >::type* = 0 #if (N == 1) , typename boost::disable_if >::type* /*dummy*/ = 0 #endif @@ -215,9 +292,19 @@ FUSION_HASH endif : base_type(base_type::init_from_sequence(seq)) {} template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence& seq + , typename boost::enable_if >::type* = 0 #if (N == 1) , typename boost::disable_if >::type* /*dummy*/ = 0 #endif @@ -225,7 +312,7 @@ FUSION_HASH endif : base_type(base_type::init_from_sequence(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N) const& vec) { @@ -234,7 +321,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { @@ -248,7 +335,7 @@ FUSION_HASH endif BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(I) { @@ -256,7 +343,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type>::type at_impl(I) const { diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 2dd584b5..c1cea915 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include #define FUSION_HASH # @@ -29,7 +31,7 @@ ctor_helper(rhs, is_base_of()) \ #define BOOST_FUSION_VECTOR_CTOR_HELPER() \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static vector_n const& \ ctor_helper(vector const& rhs, mpl::true_) \ { \ @@ -37,7 +39,7 @@ } \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static T const& \ ctor_helper(T const& rhs, mpl::false_) \ { \ @@ -100,22 +102,33 @@ namespace boost { namespace fusion typedef typename vector_n::category category; typedef typename vector_n::is_view is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector() : vec() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector const& rhs) : vec(rhs.vec) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector const& rhs) : vec(rhs.vec) {} template + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED - vector(Sequence const& rhs) + vector(Sequence const& rhs, + typename boost::enable_if >::type* = 0) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} // Expand a couple of forwarding constructors for arguments @@ -128,7 +141,7 @@ namespace boost { namespace fusion #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector const& rhs) { @@ -137,7 +150,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(T const& rhs) { @@ -145,7 +158,7 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector const& rhs) { @@ -158,10 +171,11 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector&& rhs) : vec(std::forward(rhs.vec)) {} - BOOST_FUSION_GPU_ENABLED + + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector&& rhs) { @@ -170,7 +184,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(T&& rhs) { @@ -183,7 +197,7 @@ FUSION_HASH endif #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename mpl::at_c::type >::type @@ -193,7 +207,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename add_const< typename mpl::at_c::type @@ -205,7 +219,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename mpl::at::type >::type @@ -215,7 +229,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename add_const< typename mpl::at::type diff --git a/include/boost/fusion/container/vector/vector10.hpp b/include/boost/fusion/container/vector/vector10.hpp index 4f9b18f5..a5ef4754 100644 --- a/include/boost/fusion/container/vector/vector10.hpp +++ b/include/boost/fusion/container/vector/vector10.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -51,12 +52,12 @@ namespace boost { namespace fusion typedef random_access_traversal_tag category; typedef mpl::int_<0> size; - BOOST_FUSION_GPU_ENABLED - vector0() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + vector0() BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - vector0(Sequence const& /*seq*/) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + vector0(Sequence const& /*seq*/) BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/vector/vector20.hpp b/include/boost/fusion/container/vector/vector20.hpp index 11df2420..61978dcb 100644 --- a/include/boost/fusion/container/vector/vector20.hpp +++ b/include/boost/fusion/container/vector/vector20.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector30.hpp b/include/boost/fusion/container/vector/vector30.hpp index de379a06..f034abd5 100644 --- a/include/boost/fusion/container/vector/vector30.hpp +++ b/include/boost/fusion/container/vector/vector30.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector40.hpp b/include/boost/fusion/container/vector/vector40.hpp index 2c6fd854..5a7bb44c 100644 --- a/include/boost/fusion/container/vector/vector40.hpp +++ b/include/boost/fusion/container/vector/vector40.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector50.hpp b/include/boost/fusion/container/vector/vector50.hpp index d2099665..2448d51e 100644 --- a/include/boost/fusion/container/vector/vector50.hpp +++ b/include/boost/fusion/container/vector/vector50.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector_iterator.hpp b/include/boost/fusion/container/vector/vector_iterator.hpp index 8e586c54..150530d1 100644 --- a/include/boost/fusion/container/vector/vector_iterator.hpp +++ b/include/boost/fusion/container/vector/vector_iterator.hpp @@ -37,9 +37,10 @@ namespace boost { namespace fusion typedef vector_iterator_identity< typename add_const::type, N> identity; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector_iterator(Vector& in_vec) : vec(in_vec) {} + Vector& vec; private: diff --git a/include/boost/fusion/functional/adapter/fused.hpp b/include/boost/fusion/functional/adapter/fused.hpp index c6b1b03c..c27d0acc 100644 --- a/include/boost/fusion/functional/adapter/fused.hpp +++ b/include/boost/fusion/functional/adapter/fused.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq const & s) const { @@ -51,7 +51,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq const & s) { @@ -59,7 +59,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq & s) const { @@ -67,7 +67,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq & s) { diff --git a/include/boost/fusion/functional/adapter/fused_function_object.hpp b/include/boost/fusion/functional/adapter/fused_function_object.hpp index b3973a11..cdb9c24b 100644 --- a/include/boost/fusion/functional/adapter/fused_function_object.hpp +++ b/include/boost/fusion/functional/adapter/fused_function_object.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused_function_object(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq const & s) const { @@ -52,7 +52,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq const & s) @@ -62,7 +62,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq & s) const @@ -72,7 +72,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq & s) { diff --git a/include/boost/fusion/functional/adapter/fused_procedure.hpp b/include/boost/fusion/functional/adapter/fused_procedure.hpp index 495320af..79be2176 100644 --- a/include/boost/fusion/functional/adapter/fused_procedure.hpp +++ b/include/boost/fusion/functional/adapter/fused_procedure.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused_procedure(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq const & s) const { fusion::invoke_procedure< @@ -51,7 +51,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq const & s) { fusion::invoke_procedure< @@ -59,7 +59,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq & s) const { fusion::invoke_procedure< @@ -67,7 +67,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq & s) { return fusion::invoke_procedure< diff --git a/include/boost/fusion/functional/adapter/unfused.hpp b/include/boost/fusion/functional/adapter/unfused.hpp index b02f5d28..9d85869d 100644 --- a/include/boost/fusion/functional/adapter/unfused.hpp +++ b/include/boost/fusion/functional/adapter/unfused.hpp @@ -47,14 +47,16 @@ namespace boost { namespace fusion using unfused::operator(); - BOOST_FUSION_GPU_ENABLED inline explicit unfused(func_const_fwd_t f = function()) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline explicit unfused(func_const_fwd_t f = function()) : unfused(f) { } typedef typename boost::result_of< function_c(fusion::vector0<> &) >::type call_const_0_result; - BOOST_FUSION_GPU_ENABLED inline call_const_0_result operator()() const + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline call_const_0_result operator()() const { fusion::vector0<> arg; return this->fnc_transformed(arg); @@ -63,7 +65,8 @@ namespace boost { namespace fusion typedef typename boost::result_of< function(fusion::vector0<> &) >::type call_0_result; - BOOST_FUSION_GPU_ENABLED inline call_0_result operator()() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline call_0_result operator()() { fusion::vector0<> arg; return this->fnc_transformed(arg); @@ -79,7 +82,7 @@ namespace boost { namespace fusion typedef typename detail::call_param::type func_const_fwd_t; public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit unfused(func_const_fwd_t f = function()) : fnc_transformed(f) { } @@ -149,7 +152,7 @@ namespace boost { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of & )>::type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const @@ -161,7 +164,7 @@ namespace boost } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of & )>::type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) diff --git a/include/boost/fusion/functional/adapter/unfused_typed.hpp b/include/boost/fusion/functional/adapter/unfused_typed.hpp index c3ab33dd..23faf153 100644 --- a/include/boost/fusion/functional/adapter/unfused_typed.hpp +++ b/include/boost/fusion/functional/adapter/unfused_typed.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit unfused_typed(func_const_fwd_t f = Function()) : fnc_transformed(f) { } @@ -130,7 +130,7 @@ namespace boost #define M(z,i,s) \ typename call_param::type>::type a##i - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of< function_c(arg_vector_t &) >::type operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const @@ -143,7 +143,7 @@ namespace boost return static_cast(this)->fnc_transformed(arg); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of< function(arg_vector_t &) >::type operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) diff --git a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp index b7744826..2548a086 100644 --- a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp +++ b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::BOOST_FUSION_FUNC_NAME::type BOOST_FUSION_FUNC_NAME(F const & f) { diff --git a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp index a2b4a86a..7a1a5c57 100644 --- a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp +++ b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion { namespace detail typedef typename remove_reference::type pointee; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * do_get_pointer(T &, pointee * x) { return x; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * do_get_pointer(T & x, void const *) { return get_pointer(x); @@ -39,20 +39,20 @@ namespace boost { namespace fusion { namespace detail public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(pointee * x) { return x; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(pointee & x) { return boost::addressof(x); } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(T & x) { return do_get_pointer(x, boost::addressof(x)); diff --git a/include/boost/fusion/functional/invocation/invoke.hpp b/include/boost/fusion/functional/invocation/invoke.hpp index 2de4fced..e1373542 100644 --- a/include/boost/fusion/functional/invocation/invoke.hpp +++ b/include/boost/fusion/functional/invocation/invoke.hpp @@ -150,7 +150,7 @@ namespace boost { namespace fusion typedef typename boost::add_reference::type result_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(T C::* f, Sequence & s) { typename result_of::front::type c = fusion::front(s); @@ -173,7 +173,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type invoke(Function f, Sequence & s) { @@ -183,7 +183,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type invoke(Function f, Sequence const & s) { @@ -220,7 +220,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -230,7 +230,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -251,7 +251,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -261,7 +261,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -282,7 +282,7 @@ namespace boost { namespace fusion typedef typename ft::result_type::type result_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -318,7 +318,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -330,7 +330,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -353,7 +353,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -365,7 +365,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -387,7 +387,7 @@ namespace boost { namespace fusion typedef typename ft::result_type::type result_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { diff --git a/include/boost/fusion/functional/invocation/invoke_function_object.hpp b/include/boost/fusion/functional/invocation/invoke_function_object.hpp index a5c9510c..6d414f55 100644 --- a/include/boost/fusion/functional/invocation/invoke_function_object.hpp +++ b/include/boost/fusion/functional/invocation/invoke_function_object.hpp @@ -40,12 +40,12 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function, Sequence &); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function, Sequence const &); @@ -81,7 +81,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function f, Sequence & s) { @@ -91,7 +91,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function f, Sequence const & s) { @@ -125,7 +125,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -137,7 +137,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -161,7 +161,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -177,7 +177,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { diff --git a/include/boost/fusion/functional/invocation/invoke_procedure.hpp b/include/boost/fusion/functional/invocation/invoke_procedure.hpp index bd3e49b9..028e0fe3 100644 --- a/include/boost/fusion/functional/invocation/invoke_procedure.hpp +++ b/include/boost/fusion/functional/invocation/invoke_procedure.hpp @@ -47,11 +47,11 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function, Sequence &); template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function, Sequence const &); //----- ---- --- -- - - - - @@ -77,7 +77,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function f, Sequence & s) { detail::invoke_procedure_impl< @@ -86,7 +86,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function f, Sequence const & s) { detail::invoke_procedure_impl< @@ -113,7 +113,7 @@ namespace boost { namespace fusion #if N > 0 - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { f(BOOST_PP_ENUM(N,M,~)); @@ -121,7 +121,7 @@ namespace boost { namespace fusion #else - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & /*s*/) { f(); @@ -135,7 +135,7 @@ namespace boost { namespace fusion template struct invoke_procedure_impl { - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { (that_ptr 0 - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { typedef typename result_of::begin::type I0; @@ -168,7 +168,7 @@ namespace boost { namespace fusion } #else - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & /*s*/) { f(); @@ -182,7 +182,7 @@ namespace boost { namespace fusion template struct invoke_procedure_impl { - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/iterator/deref.hpp b/include/boost/fusion/iterator/deref.hpp index b6fee6a5..c31962cb 100644 --- a/include/boost/fusion/iterator/deref.hpp +++ b/include/boost/fusion/iterator/deref.hpp @@ -56,7 +56,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref::type + inline typename result_of::deref::type deref(Iterator const& i) { typedef result_of::deref deref_meta; @@ -65,7 +65,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref::type + inline typename result_of::deref::type operator*(iterator_base const& i) { return fusion::deref(i.cast()); diff --git a/include/boost/fusion/iterator/deref_data.hpp b/include/boost/fusion/iterator/deref_data.hpp index 20d82ebf..65a43324 100644 --- a/include/boost/fusion/iterator/deref_data.hpp +++ b/include/boost/fusion/iterator/deref_data.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref_data::type + inline typename result_of::deref_data::type deref_data(It const& it) { return result_of::deref_data::call(it); diff --git a/include/boost/fusion/iterator/next.hpp b/include/boost/fusion/iterator/next.hpp index 20d3df94..d6ca3d66 100644 --- a/include/boost/fusion/iterator/next.hpp +++ b/include/boost/fusion/iterator/next.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::next::type const + inline typename result_of::next::type const next(Iterator const& i) { return result_of::next::call(i); diff --git a/include/boost/fusion/iterator/prior.hpp b/include/boost/fusion/iterator/prior.hpp index a3541280..80e891c7 100644 --- a/include/boost/fusion/iterator/prior.hpp +++ b/include/boost/fusion/iterator/prior.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::prior::type const + inline typename result_of::prior::type const prior(Iterator const& i) { return result_of::prior::call(i); diff --git a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp index 577023db..cffed6c3 100644 --- a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_equal_to { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& /*a*/, I2 const& /*b*/) { diff --git a/include/boost/fusion/sequence/comparison/detail/greater.hpp b/include/boost/fusion/sequence/comparison/detail/greater.hpp index d875f16b..d7626529 100644 --- a/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ b/include/boost/fusion/sequence/comparison/detail/greater.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp index e0aa530e..d15d88c4 100644 --- a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp +++ b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/less.hpp b/include/boost/fusion/sequence/comparison/detail/less.hpp index 8964ca7d..04377d69 100644 --- a/include/boost/fusion/sequence/comparison/detail/less.hpp +++ b/include/boost/fusion/sequence/comparison/detail/less.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp index 10bcb767..e61d33c4 100644 --- a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp index b230ac1f..323b2ac9 100644 --- a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_not_equal_to { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/equal_to.hpp b/include/boost/fusion/sequence/comparison/equal_to.hpp index 485df0ba..283ffefc 100644 --- a/include/boost/fusion/sequence/comparison/equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool equal_to(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality diff --git a/include/boost/fusion/sequence/comparison/greater.hpp b/include/boost/fusion/sequence/comparison/greater.hpp index 5ad7ef74..fbbb7bfa 100644 --- a/include/boost/fusion/sequence/comparison/greater.hpp +++ b/include/boost/fusion/sequence/comparison/greater.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/greater_equal.hpp b/include/boost/fusion/sequence/comparison/greater_equal.hpp index 65904f83..7b91a888 100644 --- a/include/boost/fusion/sequence/comparison/greater_equal.hpp +++ b/include/boost/fusion/sequence/comparison/greater_equal.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater_equal(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/less.hpp b/include/boost/fusion/sequence/comparison/less.hpp index 28762b73..b056552a 100644 --- a/include/boost/fusion/sequence/comparison/less.hpp +++ b/include/boost/fusion/sequence/comparison/less.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less(Seq1 const& a, Seq2 const& b) { @@ -29,7 +29,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/less_equal.hpp b/include/boost/fusion/sequence/comparison/less_equal.hpp index d0668208..53159926 100644 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less_equal(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion #if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400) // Workaround for VC8.0 and VC7.1 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator<=(sequence_base const& a, sequence_base const& b) { @@ -49,7 +49,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if, bool>::type operator<=(sequence_base const& a, Seq2 const& b) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if, bool>::type operator<=(Seq1 const& a, sequence_base const& b) { @@ -69,7 +69,7 @@ namespace boost { namespace fusion // but barfs somewhere else. template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/not_equal_to.hpp index 4cd94f9e..fc2fef33 100644 --- a/include/boost/fusion/sequence/comparison/not_equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/not_equal_to.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool not_equal_to(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality diff --git a/include/boost/fusion/sequence/convert.hpp b/include/boost/fusion/sequence/convert.hpp index 461b9212..b367714c 100644 --- a/include/boost/fusion/sequence/convert.hpp +++ b/include/boost/fusion/sequence/convert.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_CONVERT_10022005_1442) #define FUSION_CONVERT_10022005_1442 +#include + namespace boost { namespace fusion { namespace extension @@ -29,7 +31,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert::type convert(Sequence& seq) { @@ -38,7 +40,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert::type convert(Sequence const& seq) { diff --git a/include/boost/fusion/support/as_const.hpp b/include/boost/fusion/support/as_const.hpp index ed535970..04d5bfcc 100644 --- a/include/boost/fusion/support/as_const.hpp +++ b/include/boost/fusion/support/as_const.hpp @@ -7,6 +7,9 @@ #ifndef BOOST_FUSION_SUPPORT_AS_CONST_HPP #define BOOST_FUSION_SUPPORT_AS_CONST_HPP +#include +#include + namespace boost { namespace fusion { namespace extension { // A customization point that allows certain wrappers around @@ -16,8 +19,8 @@ namespace boost { namespace fusion { namespace extension // such contexts with calls to this function. Users can // specialize this function for their own wrappers. template - BOOST_FUSION_GPU_ENABLED - const T& as_const(const T& obj) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline const T& as_const(const T& obj) BOOST_NOEXCEPT { return obj; } diff --git a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp index 514e8d95..6a388bf8 100644 --- a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp +++ b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -66,8 +66,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename result_of::make_segmented_iterator::type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename result_of::make_segmented_iterator::type make_segmented_iterator(Cur const& cur, Context const& context) { typedef result_of::make_segmented_iterator impl_type; @@ -121,7 +121,7 @@ namespace boost { namespace fusion typedef iterator_range range_type; typedef cons type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cur const& cur, End const& end, Context const& context) { return cons(range_type(cur, end), context); @@ -170,7 +170,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) { return impl::call(fusion::segments(seq), state, context, fun); @@ -192,7 +192,7 @@ namespace boost { namespace fusion typedef typename apply_type::type type; typedef typename apply_type::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) { return apply_type::call(seq, state, context, fun); @@ -274,14 +274,14 @@ namespace boost { namespace fusion >::type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun, mpl::true_) // continue { @@ -297,7 +297,7 @@ namespace boost { namespace fusion , fun); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun, mpl::false_) // break { @@ -325,7 +325,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { @@ -351,7 +351,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { @@ -365,7 +365,7 @@ namespace boost { namespace fusion typedef State type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const&, End const&, State const& state , Context const&, Fun const&) { @@ -389,7 +389,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) { return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); diff --git a/include/boost/fusion/support/iterator_base.hpp b/include/boost/fusion/support/iterator_base.hpp index d23d05c6..5d8ce3ab 100644 --- a/include/boost/fusion/support/iterator_base.hpp +++ b/include/boost/fusion/support/iterator_base.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_ITERATOR_BASE_05042005_1008) #define FUSION_ITERATOR_BASE_05042005_1008 +#include #include namespace boost { namespace fusion @@ -16,16 +17,16 @@ namespace boost { namespace fusion template struct iterator_base : iterator_root { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED Iterator const& - cast() const + cast() const BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED Iterator& - cast() + cast() BOOST_NOEXCEPT { return static_cast(*this); } diff --git a/include/boost/fusion/support/pair.hpp b/include/boost/fusion/support/pair.hpp index b09c7b4b..fd5d57e6 100644 --- a/include/boost/fusion/support/pair.hpp +++ b/include/boost/fusion/support/pair.hpp @@ -29,51 +29,47 @@ namespace boost { namespace fusion template struct pair { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair() : second() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair&& rhs) : second(BOOST_FUSION_FWD_ELEM(Second, rhs.second)) {} - #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(typename detail::call_param::type val) : second(val) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - - BOOST_FUSION_GPU_ENABLED template + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(Second2&& val , typename boost::disable_if >::type* /* dummy */ = 0 , typename boost::enable_if >::type* /*dummy*/ = 0 ) : second(BOOST_FUSION_FWD_ELEM(Second, val)) {} - #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; @@ -81,7 +77,7 @@ namespace boost { namespace fusion } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair&& rhs) { second = BOOST_FUSION_FWD_ELEM(Second, rhs.second); @@ -117,7 +113,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::make_pair::type make_pair(Second const& val) { @@ -141,7 +137,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator==(pair const& l, pair const& r) { @@ -149,7 +145,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator!=(pair const& l, pair const& r) { @@ -157,7 +153,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator<(pair const& l, pair const& r) { diff --git a/include/boost/fusion/support/segmented_fold_until.hpp b/include/boost/fusion/support/segmented_fold_until.hpp index 8d3ea682..9e6f4a50 100644 --- a/include/boost/fusion/support/segmented_fold_until.hpp +++ b/include/boost/fusion/support/segmented_fold_until.hpp @@ -45,8 +45,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::segmented_fold_until @@ -56,19 +56,19 @@ namespace boost { namespace fusion typedef typename result_of::segmented_fold_until::filter filter; - + return filter::call(seq, state, fusion::nil_(), fun); } template - BOOST_FUSION_GPU_ENABLED - typename result_of::segmented_fold_until::type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename result_of::segmented_fold_until::type segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun) { typedef typename result_of::segmented_fold_until::filter filter; - + return filter::call(seq, state, fusion::nil_(), fun); } }} diff --git a/include/boost/fusion/support/sequence_base.hpp b/include/boost/fusion/support/sequence_base.hpp index b59121c0..2f9320e6 100644 --- a/include/boost/fusion/support/sequence_base.hpp +++ b/include/boost/fusion/support/sequence_base.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_SEQUENCE_BASE_04182005_0737) #define FUSION_SEQUENCE_BASE_04182005_0737 +#include #include #include @@ -22,22 +23,22 @@ namespace boost { namespace fusion template struct sequence_base { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED Sequence const& - derived() const + derived() const BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED Sequence& - derived() + derived() BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED - operator detail::from_sequence_convertible_type()const + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + operator detail::from_sequence_convertible_type() const BOOST_NOEXCEPT { return detail::from_sequence_convertible_type(); } diff --git a/include/boost/fusion/support/unused.hpp b/include/boost/fusion/support/unused.hpp index b3eec5ce..4bbe24e8 100644 --- a/include/boost/fusion/support/unused.hpp +++ b/include/boost/fusion/support/unused.hpp @@ -22,65 +22,67 @@ namespace boost { namespace fusion { struct unused_type { - BOOST_FUSION_GPU_ENABLED - unused_type() + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_type() BOOST_NOEXCEPT { } template - BOOST_FUSION_GPU_ENABLED - unused_type(T const&) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_type(T const&) BOOST_NOEXCEPT { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type const& - operator=(T const&) const + operator=(T const&) const BOOST_NOEXCEPT { return *this; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type& - operator=(T const&) + operator=(T const&) BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type const& - operator=(unused_type const&) const + operator=(unused_type const&) const BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type& - operator=(unused_type const&) + operator=(unused_type const&) BOOST_NOEXCEPT { return *this; } }; - unused_type const unused = unused_type(); + BOOST_CONSTEXPR unused_type const unused = unused_type(); namespace detail { struct unused_only { - BOOST_FUSION_GPU_ENABLED - unused_only(unused_type const&) {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_only(unused_type const&) BOOST_NOEXCEPT {} }; } - inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) + BOOST_CONSTEXPR + inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) BOOST_NOEXCEPT { return out; } - inline std::istream& operator>>(std::istream& in, unused_type&) + BOOST_CONSTEXPR + inline std::istream& operator>>(std::istream& in, unused_type&) BOOST_NOEXCEPT { return in; } diff --git a/include/boost/fusion/view/detail/strictest_traversal.hpp b/include/boost/fusion/view/detail/strictest_traversal.hpp index 4092ea4d..9ad1f7aa 100644 --- a/include/boost/fusion/view/detail/strictest_traversal.hpp +++ b/include/boost/fusion/view/detail/strictest_traversal.hpp @@ -59,7 +59,7 @@ namespace boost { namespace fusion // never called, but needed for decltype-based result_of (C++0x) #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(StrictestSoFar&&, Next&&) const; #endif diff --git a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp index 89f67d02..3ce439a4 100644 --- a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename Sequence::category category; typedef filter_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp index ba8631f5..e0d9a0ed 100644 --- a/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/filter_view/detail/end_impl.hpp b/include/boost/fusion/view/filter_view/detail/end_impl.hpp index fee9f6d4..1a2a5ba4 100644 --- a/include/boost/fusion/view/filter_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/end_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef typename Sequence::category category; typedef filter_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/view/filter_view/detail/next_impl.hpp index 0091e897..4f174557 100644 --- a/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion category, typename filter::type, last_type, pred_type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/filter_view/filter_view.hpp b/include/boost/fusion/view/filter_view/filter_view.hpp index dd710fab..db61cad6 100644 --- a/include/boost/fusion/view/filter_view/filter_view.hpp +++ b/include/boost/fusion/view/filter_view/filter_view.hpp @@ -46,14 +46,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type last_type; typedef Pred pred_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED filter_view(Sequence& in_seq) : seq(in_seq) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; diff --git a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp index d407c9da..f1b9f54d 100644 --- a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef last_iter last_type; typedef Pred pred_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED filter_iterator(First const& in_first) : first(filter::iter_call(first_converter::call(in_first))) {} diff --git a/include/boost/fusion/view/flatten_view/flatten_view.hpp b/include/boost/fusion/view/flatten_view/flatten_view.hpp index aa472407..8e40158d 100644 --- a/include/boost/fusion/view/flatten_view/flatten_view.hpp +++ b/include/boost/fusion/view/flatten_view/flatten_view.hpp @@ -8,6 +8,7 @@ #define BOOST_FUSION_FLATTEN_VIEW_HPP_INCLUDED +#include #include #include #include @@ -23,7 +24,7 @@ namespace boost { namespace fusion { struct forward_traversal_tag; struct flatten_view_tag; - + template struct flatten_view : sequence_base > @@ -32,18 +33,21 @@ namespace boost { namespace fusion typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; typedef forward_traversal_tag category; - + typedef Sequence sequence_type; typedef typename result_of::begin::type first_type; typedef typename result_of::end::type last_type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit flatten_view(Sequence& seq) : seq(seq) {} - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } - + typename mpl::if_, Sequence, Sequence&>::type seq; }; }} @@ -57,19 +61,20 @@ namespace boost { namespace fusion { namespace extension struct apply { typedef typename Sequence::first_type first_type; - + typedef typename result_of::begin< mpl::single_view< typename Sequence::sequence_type> >::type root_iterator; - + typedef detail::seek_descent seek_descent; - + typedef typename seek_descent::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Sequence& seq) { @@ -77,7 +82,7 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct end_impl { @@ -85,13 +90,14 @@ namespace boost { namespace fusion { namespace extension struct apply { typedef typename Sequence::last_type last_type; - + typedef typename result_of::end< mpl::single_view< typename Sequence::sequence_type> >::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Sequence&) { diff --git a/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp b/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp index e47868c1..1ecf6928 100644 --- a/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp +++ b/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp @@ -8,6 +8,7 @@ #define BOOST_FUSION_FLATTEN_VIEW_ITERATOR_HPP_INCLUDED +#include #include #include #include @@ -23,22 +24,23 @@ namespace boost { namespace fusion { struct forward_traversal_tag; struct flatten_view_iterator_tag; - + template struct flatten_view_iterator : iterator_base > { typedef flatten_view_iterator_tag fusion_tag; typedef forward_traversal_tag category; - + typedef convert_iterator first_converter; typedef typename first_converter::type first_type; typedef Base base_type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED flatten_view_iterator(First const& first, Base const& base) : first(first), base(base) {} - + first_type first; base_type base; }; @@ -50,13 +52,14 @@ namespace boost { namespace fusion { namespace detail struct make_descent_cons { typedef cons type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Iterator const& it) { return type(it); } }; - + template struct make_descent_cons::type>::type sub_sequence; - + typedef typename result_of::begin::type sub_begin; - + typedef cons::type> type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Iterator const& it) { return type(it, make_descent_cons::apply( fusion::begin(*it))); } }; - + template struct build_flatten_view_iterator; @@ -88,26 +92,28 @@ namespace boost { namespace fusion { namespace detail struct build_flatten_view_iterator, Base> { typedef flatten_view_iterator type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(cons const& cons, Base const& base) { return type(cons.car, base); } }; - + template struct build_flatten_view_iterator, Base> { typedef flatten_view_iterator next_base; typedef build_flatten_view_iterator next; typedef typename next::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(cons const& cons, Base const& base) { return next::apply(cons.cdr, next_base(cons.car, base)); } }; - + template struct seek_descent { @@ -117,14 +123,15 @@ namespace boost { namespace fusion { namespace detail build_flatten_view_iterator build_flatten_view_iterator_; typedef typename build_flatten_view_iterator_::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Base const& base, Iterator const& it) { return build_flatten_view_iterator_::apply( make_descent_cons_::apply(it), base); } }; - + template struct seek_descent::type>::type> >::type> { typedef typename result_of::next::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Base const& base, Iterator const&) { return fusion::next(base); @@ -151,10 +159,11 @@ namespace boost { namespace fusion { namespace extension typedef typename Iterator::first_type first_type; typedef typename Iterator::base_type base_type; typedef typename result_of::next::type next_type; - + typedef detail::seek_descent seek_descent; typedef typename seek_descent::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Iterator const& it) { @@ -162,7 +171,7 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct deref_impl { @@ -173,6 +182,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Iterator const& it) { @@ -180,13 +190,13 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct value_of_impl { template struct apply - { + { typedef typename result_of::value_of::type type; diff --git a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp index 0626ae2e..20f17583 100644 --- a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename result_of::advance::type pos; typedef typename result_of::deref::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp index e34b6ede..7e00dec0 100644 --- a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_BEGIN_IMPL_05062005_1226) #define FUSION_BEGIN_IMPL_05062005_1226 +#include + namespace boost { namespace fusion { struct iterator_range_tag; @@ -24,7 +26,7 @@ namespace boost { namespace fusion { typedef typename Sequence::begin_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp index 2428198c..b76aa91c 100644 --- a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_END_IMPL_05062005_1226) #define FUSION_END_IMPL_05062005_1226 +#include + namespace boost { namespace fusion { struct iterator_range_tag; @@ -24,7 +26,7 @@ namespace boost { namespace fusion { typedef typename Sequence::end_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp index 7dc4506c..d35e580f 100644 --- a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -48,8 +48,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_back @@ -57,8 +57,8 @@ namespace boost { namespace fusion push_back(Sequence const& seq, T const& x); template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_front @@ -152,7 +152,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { //return segment_sequence( @@ -199,7 +199,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin)))); @@ -212,7 +212,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename Stack::cdr_type type; // nil_ - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const &stack) { return stack.cdr; @@ -298,7 +298,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return segment_sequence( @@ -345,7 +345,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end)))); @@ -358,7 +358,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename Stack::cdr_type type; // nil_ - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { return stack.cdr; @@ -437,7 +437,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { //return segment_sequence( @@ -471,7 +471,7 @@ namespace boost { namespace fusion { namespace detail typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { return impl::call(stack_begin.cdr, stack_end.cdr); @@ -501,7 +501,7 @@ namespace boost { namespace fusion { namespace detail segment_sequence type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { //return segment_sequence( @@ -531,7 +531,7 @@ namespace boost { namespace fusion { namespace detail typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& begin, End const& end) { return impl::call( diff --git a/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp index 9d570cf1..bbf4c45a 100644 --- a/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion typename result_of::segments::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence & seq) { return fusion::segments(impl::call(seq.first, seq.last)); diff --git a/include/boost/fusion/view/iterator_range/iterator_range.hpp b/include/boost/fusion/view/iterator_range/iterator_range.hpp index f5aafd4a..272abcd9 100644 --- a/include/boost/fusion/view/iterator_range/iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/iterator_range.hpp @@ -44,7 +44,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED iterator_range(First const& in_first, Last const& in_last) : first(convert_iterator::call(in_first)) , last(convert_iterator::call(in_last)) {} diff --git a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp index f58d1290..b7a961a7 100644 --- a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp @@ -43,21 +43,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s, mpl::true_) { return s.concat(); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s, mpl::false_) { return type(s.first(), s.concat()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp index 02780d99..2d5f8317 100644 --- a/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/joint_view/detail/end_impl.hpp b/include/boost/fusion/view/joint_view/detail/end_impl.hpp index b9e01138..0b4b9b0a 100644 --- a/include/boost/fusion/view/joint_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/end_impl.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { typedef typename Sequence::concat_last_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/joint_view/detail/next_impl.hpp b/include/boost/fusion/view/joint_view/detail/next_impl.hpp index a3c066d1..a7d18757 100644 --- a/include/boost/fusion/view/joint_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/next_impl.hpp @@ -45,21 +45,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i, mpl::true_) { return i.concat; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i, mpl::false_) { return type(fusion::next(i.first), i.concat); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/joint_view/joint_view.hpp b/include/boost/fusion/view/joint_view/joint_view.hpp index 3ad31914..676cbc54 100644 --- a/include/boost/fusion/view/joint_view/joint_view.hpp +++ b/include/boost/fusion/view/joint_view/joint_view.hpp @@ -56,17 +56,17 @@ namespace boost { namespace fusion result_of::size::value + result_of::size::value> size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED joint_view(Sequence1& in_seq1, Sequence2& in_seq2) : seq1(in_seq1) , seq2(in_seq2) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_type concat() const { return fusion::begin(seq2); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_last_type concat_last() const { return fusion::end(seq2); } private: diff --git a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp index d73a24fd..ddd1341e 100644 --- a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp +++ b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion typedef Category category; BOOST_STATIC_ASSERT((!result_of::equal_to::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED joint_view_iterator(First const& in_first, Concat const& in_concat) : first(first_converter::call(in_first)) , concat(concat_converter::call(in_concat)) diff --git a/include/boost/fusion/view/nview/detail/advance_impl.hpp b/include/boost/fusion/view/nview/detail/advance_impl.hpp index ad82983e..7c74a386 100644 --- a/include/boost/fusion/view/nview/detail/advance_impl.hpp +++ b/include/boost/fusion/view/nview/detail/advance_impl.hpp @@ -12,7 +12,7 @@ #include #include -namespace boost { namespace fusion +namespace boost { namespace fusion { struct nview_iterator_tag; @@ -36,7 +36,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/detail/at_impl.hpp b/include/boost/fusion/view/nview/detail/at_impl.hpp index 45f9faf6..b9f41def 100644 --- a/include/boost/fusion/view/nview/detail/at_impl.hpp +++ b/include/boost/fusion/view/nview/detail/at_impl.hpp @@ -11,7 +11,7 @@ #include #include -namespace boost { namespace fusion +namespace boost { namespace fusion { struct nview_tag; @@ -32,8 +32,8 @@ namespace boost { namespace fusion typedef typename result_of::at::type index; typedef typename result_of::at::type type; - BOOST_FUSION_GPU_ENABLED - static type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq) { return fusion::at(seq.seq); diff --git a/include/boost/fusion/view/nview/detail/begin_impl.hpp b/include/boost/fusion/view/nview/detail/begin_impl.hpp index ca600b9a..bab5e221 100644 --- a/include/boost/fusion/view/nview/detail/begin_impl.hpp +++ b/include/boost/fusion/view/nview/detail/begin_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { return type(s); diff --git a/include/boost/fusion/view/nview/detail/deref_impl.hpp b/include/boost/fusion/view/nview/detail/deref_impl.hpp index bbdb9825..85991021 100644 --- a/include/boost/fusion/view/nview/detail/deref_impl.hpp +++ b/include/boost/fusion/view/nview/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename result_of::at< typename sequence_type::sequence_type, index>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return at(i.seq.seq); diff --git a/include/boost/fusion/view/nview/detail/distance_impl.hpp b/include/boost/fusion/view/nview/detail/distance_impl.hpp index e3e5a9a0..a036300f 100644 --- a/include/boost/fusion/view/nview/detail/distance_impl.hpp +++ b/include/boost/fusion/view/nview/detail/distance_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typename First::first_type, typename Last::first_type >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& /*first*/, Last const& /*last*/) { diff --git a/include/boost/fusion/view/nview/detail/end_impl.hpp b/include/boost/fusion/view/nview/detail/end_impl.hpp index d36260db..0a6efe56 100644 --- a/include/boost/fusion/view/nview/detail/end_impl.hpp +++ b/include/boost/fusion/view/nview/detail/end_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { return type(s); diff --git a/include/boost/fusion/view/nview/detail/next_impl.hpp b/include/boost/fusion/view/nview/detail/next_impl.hpp index 5193bfe6..3c304096 100644 --- a/include/boost/fusion/view/nview/detail/next_impl.hpp +++ b/include/boost/fusion/view/nview/detail/next_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/detail/nview_impl.hpp b/include/boost/fusion/view/nview/detail/nview_impl.hpp index 6c7a3e21..e0d93356 100644 --- a/include/boost/fusion/view/nview/detail/nview_impl.hpp +++ b/include/boost/fusion/view/nview/detail/nview_impl.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion { namespace result_of namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline nview > as_nview(Sequence& s) { diff --git a/include/boost/fusion/view/nview/detail/prior_impl.hpp b/include/boost/fusion/view/nview/detail/prior_impl.hpp index 374b45f6..470c5bd3 100644 --- a/include/boost/fusion/view/nview/detail/prior_impl.hpp +++ b/include/boost/fusion/view/nview/detail/prior_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/nview.hpp b/include/boost/fusion/view/nview/nview.hpp index 45b7380b..2e257c81 100644 --- a/include/boost/fusion/view/nview/nview.hpp +++ b/include/boost/fusion/view/nview/nview.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type operator()(T& x) const { @@ -48,7 +48,7 @@ namespace boost { namespace fusion } #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(T&& x) const { @@ -68,7 +68,7 @@ namespace boost { namespace fusion {}; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type operator()(T& x) const { @@ -76,7 +76,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type operator()(T const& x) const { @@ -108,7 +108,8 @@ namespace boost { namespace fusion typedef typename result_of::as_vector::type sequence_type; - BOOST_FUSION_GPU_ENABLED explicit nview(Sequence& val) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit nview(Sequence& val) : seq(sequence_type(transform_view_type(val, transform_type()))) {} diff --git a/include/boost/fusion/view/nview/nview_iterator.hpp b/include/boost/fusion/view/nview/nview_iterator.hpp index b1111e84..aeaf4620 100644 --- a/include/boost/fusion/view/nview/nview_iterator.hpp +++ b/include/boost/fusion/view/nview/nview_iterator.hpp @@ -42,7 +42,8 @@ namespace boost { namespace fusion typedef Sequence sequence_type; typedef mpl_iterator first_type; - BOOST_FUSION_GPU_ENABLED explicit nview_iterator(Sequence& in_seq) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit nview_iterator(Sequence& in_seq) : seq(in_seq) {} Sequence& seq; diff --git a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp index 3da6b21d..9a27156c 100644 --- a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef repetitive_view_iterator::type > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(View const& v) { return type(v.seq); diff --git a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp index c54ff38e..c96ef5eb 100644 --- a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion result_of::deref::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return *i.pos; diff --git a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp index ca1c270f..af1fa6ee 100644 --- a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef repetitive_view_iterator::type > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(View const& v) { return type(v.seq,end(v.seq)); diff --git a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp index acefd513..fab75408 100644 --- a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp @@ -42,7 +42,7 @@ namespace boost { namespace fusion > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i.seq, next(i.pos)); @@ -59,7 +59,7 @@ namespace boost { namespace fusion > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i.seq); @@ -80,7 +80,7 @@ namespace boost { namespace fusion typedef Iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i); diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp index ab0a3b18..32718e04 100644 --- a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp +++ b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion mpl::if_, Sequence, sequence_type&>::type stored_seq_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED repetitive_view(Sequence& in_seq) : seq(in_seq) {} diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp index ea9e491e..74cc723e 100644 --- a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp +++ b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp @@ -36,16 +36,16 @@ namespace boost { namespace fusion typedef typename convert_iterator::type>::type end_type; typedef single_pass_traversal_tag category; - BOOST_FUSION_GPU_ENABLED explicit repetitive_view_iterator(Sequence& in_seq) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit repetitive_view_iterator(Sequence& in_seq) : seq(in_seq), pos(begin(in_seq)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED repetitive_view_iterator(Sequence& in_seq, pos_type const& in_pos) : seq(in_seq), pos(in_pos) {} Sequence& seq; pos_type pos; - private: // silence MSVC warning C4512: assignment operator could not be generated diff --git a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp index 1304d0a9..42b3bd19 100644 --- a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion { typedef typename result_of::advance::type advanced_type; typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/at_impl.hpp b/include/boost/fusion/view/reverse_view/detail/at_impl.hpp index ebad8f35..d1fc7715 100644 --- a/include/boost/fusion/view/reverse_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/at_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion { namespace extension result_of::at::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp index 2f20df57..913725ed 100644 --- a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& s) { diff --git a/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp index 20d381ba..e93b8fba 100644 --- a/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp index 530921fe..9ea60d81 100644 --- a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp index 3a5fdc61..49436c26 100644 --- a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typedef typename Last::first_type last_type; typedef typename result_of::distance::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, Last const& last) { diff --git a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp index 1747d64f..06602c0e 100644 --- a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& s) { diff --git a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp index 1aaa6920..58c1f5f7 100644 --- a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp index 4007ad4d..69d18501 100644 --- a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/reverse_view.hpp b/include/boost/fusion/view/reverse_view/reverse_view.hpp index 3b134d5f..0a9aca27 100644 --- a/include/boost/fusion/view/reverse_view/reverse_view.hpp +++ b/include/boost/fusion/view/reverse_view/reverse_view.hpp @@ -50,14 +50,14 @@ namespace boost { namespace fusion bidirectional_traversal_tag , typename traits::category_of::type>::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED reverse_view(Sequence& in_seq) : seq(in_seq) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; diff --git a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp index b773f15d..a73e4eea 100644 --- a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp +++ b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp @@ -42,7 +42,7 @@ namespace boost { namespace fusion bidirectional_traversal_tag , category>::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED reverse_view_iterator(First const& in_first) : first(converter::call(in_first)) {} diff --git a/include/boost/fusion/view/single_view/detail/advance_impl.hpp b/include/boost/fusion/view/single_view/detail/advance_impl.hpp index 9dd9e4d7..5af22321 100644 --- a/include/boost/fusion/view/single_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/advance_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typename mpl::plus::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/at_impl.hpp b/include/boost/fusion/view/single_view/detail/at_impl.hpp index b63497c8..6c4c7579 100644 --- a/include/boost/fusion/view/single_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion BOOST_MPL_ASSERT((mpl::equal_to >)); typedef typename Sequence::value_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/begin_impl.hpp b/include/boost/fusion/view/single_view/detail/begin_impl.hpp index 63e42923..d6bca8f6 100644 --- a/include/boost/fusion/view/single_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef single_view_iterator > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/deref_impl.hpp b/include/boost/fusion/view/single_view/detail/deref_impl.hpp index ad50a413..acb90d83 100644 --- a/include/boost/fusion/view/single_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/deref_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion BOOST_MPL_ASSERT((mpl::equal_to >)); typedef typename Iterator::value_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/distance_impl.hpp b/include/boost/fusion/view/single_view/detail/distance_impl.hpp index 73231b41..9cd85fdc 100644 --- a/include/boost/fusion/view/single_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/distance_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef typename mpl::minus::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& /*first*/, Last const& /*last*/) { diff --git a/include/boost/fusion/view/single_view/detail/end_impl.hpp b/include/boost/fusion/view/single_view/detail/end_impl.hpp index 50a7c562..d662ac24 100644 --- a/include/boost/fusion/view/single_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/end_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef single_view_iterator > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/next_impl.hpp b/include/boost/fusion/view/single_view/detail/next_impl.hpp index d5e0ac80..41c658f3 100644 --- a/include/boost/fusion/view/single_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/next_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typename mpl::next::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/prior_impl.hpp b/include/boost/fusion/view/single_view/detail/prior_impl.hpp index c34e481a..823f96e5 100644 --- a/include/boost/fusion/view/single_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/prior_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typename mpl::prior::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/single_view.hpp b/include/boost/fusion/view/single_view/single_view.hpp index 36c2c931..a4437902 100644 --- a/include/boost/fusion/view/single_view/single_view.hpp +++ b/include/boost/fusion/view/single_view/single_view.hpp @@ -43,18 +43,19 @@ namespace boost { namespace fusion typedef mpl::int_<1> size; typedef T value_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED single_view() : val() {} - BOOST_FUSION_GPU_ENABLED explicit single_view(typename detail::call_param::type in_val) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit single_view(typename detail::call_param::type in_val) : val(in_val) {} value_type val; }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline single_view::type> make_single_view(T const& v) { diff --git a/include/boost/fusion/view/single_view/single_view_iterator.hpp b/include/boost/fusion/view/single_view/single_view_iterator.hpp index 50c15466..0f3e2744 100644 --- a/include/boost/fusion/view/single_view/single_view_iterator.hpp +++ b/include/boost/fusion/view/single_view/single_view_iterator.hpp @@ -40,7 +40,8 @@ namespace boost { namespace fusion typedef Pos position; typedef SingleView single_view_type; - BOOST_FUSION_GPU_ENABLED explicit single_view_iterator(single_view_type& in_view) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit single_view_iterator(single_view_type& in_view) : view(in_view) {} SingleView& view; diff --git a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp index ae8a84ce..12dfabec 100644 --- a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/at_impl.hpp b/include/boost/fusion/view/transform_view/detail/at_impl.hpp index 5c6dd8fb..d2045bc2 100644 --- a/include/boost/fusion/view/transform_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/at_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typedef typename boost::fusion::result_of::at::type value_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { return seq.f(boost::fusion::at(seq.seq)); @@ -53,7 +53,7 @@ namespace boost { namespace fusion { typedef typename boost::fusion::result_of::at::type value2_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { return seq.f(boost::fusion::at(seq.seq1), boost::fusion::at(seq.seq2)); diff --git a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp index 7c40505a..da3f763a 100644 --- a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp index 35dacbd1..646da57c 100644 --- a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp @@ -37,7 +37,7 @@ namespace boost { namespace fusion typedef detail::apply_transform_result transform_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -63,7 +63,7 @@ namespace boost { namespace fusion typedef detail::apply_transform_result transform_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp index ecbc8c5d..64443055 100644 --- a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion { struct apply : result_of::distance { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename result_of::distance::type call(First const& first, Last const& last) @@ -47,7 +47,7 @@ namespace boost { namespace fusion { struct apply : result_of::distance { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename result_of::distance::type call(First const& first, Last const& last) diff --git a/include/boost/fusion/view/transform_view/detail/end_impl.hpp b/include/boost/fusion/view/transform_view/detail/end_impl.hpp index 58e161b1..3a84e040 100644 --- a/include/boost/fusion/view/transform_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/end_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/transform_view/detail/next_impl.hpp b/include/boost/fusion/view/transform_view/detail/next_impl.hpp index cebba595..ce22d19e 100644 --- a/include/boost/fusion/view/transform_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/next_impl.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -61,7 +61,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp index 19c802c6..ed6d742e 100644 --- a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/transform_view.hpp b/include/boost/fusion/view/transform_view/transform_view.hpp index d18f49c6..4a6fc5b1 100644 --- a/include/boost/fusion/view/transform_view/transform_view.hpp +++ b/include/boost/fusion/view/transform_view/transform_view.hpp @@ -56,20 +56,20 @@ namespace boost { namespace fusion typedef Sequence2 sequence2_type; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view(Sequence1& in_seq1, Sequence2& in_seq2, F const& binop) : f(binop) , seq1(in_seq1) , seq2(in_seq2) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first1_type first1() const { return fusion::begin(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first2_type first2() const { return fusion::begin(seq2); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last1_type last1() const { return fusion::end(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last2_type last2() const { return fusion::end(seq2); } transform_type f; @@ -100,15 +100,15 @@ namespace boost { namespace fusion typedef Sequence sequence_type; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view(Sequence& in_seq, F const& in_f) : seq(in_seq) , f(in_f) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; transform_type f; diff --git a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp index 19310fe1..ab40bd74 100644 --- a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp +++ b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view_iterator(First const& in_first, F const& in_f) : first(converter::call(in_first)), f(in_f) {} @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f) : first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {} diff --git a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp index 17012ac8..69134d94 100644 --- a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { typedef zip_view_iterator< typename result_of::transform >::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/at_impl.hpp b/include/boost/fusion/view/zip_view/detail/at_impl.hpp index f92c9817..55c0fef1 100644 --- a/include/boost/fusion/view/zip_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/at_impl.hpp @@ -44,7 +44,7 @@ namespace boost { namespace fusion }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -52,14 +52,14 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::at(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -82,7 +82,7 @@ namespace boost { namespace fusion typename result_of::transform< typename Seq::sequences, detail::poly_at >::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp index 32be2c7d..75e13751 100644 --- a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -49,14 +49,14 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -79,7 +79,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Sequence::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& sequence) { diff --git a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp index e9f091c3..df7e91ae 100644 --- a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp @@ -43,14 +43,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::deref(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -72,7 +72,7 @@ namespace boost { namespace fusion { typedef typename result_of::as_vector< typename result_of::transform::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp index 8beaccca..f306e1b4 100644 --- a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp @@ -70,7 +70,7 @@ namespace boost { namespace fusion { struct apply : detail::zip_view_iterator_distance::type { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename detail::zip_view_iterator_distance::type call(It1 const& /*it1*/, It2 const& /*it2*/) { diff --git a/include/boost/fusion/view/zip_view/detail/end_impl.hpp b/include/boost/fusion/view/zip_view/detail/end_impl.hpp index d57b08fb..28549cb7 100644 --- a/include/boost/fusion/view/zip_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/end_impl.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -63,14 +63,14 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::advance(fusion::begin(seq)); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -93,7 +93,7 @@ namespace boost { namespace fusion { typename result_of::transform >::type, typename Sequence::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& sequence) { diff --git a/include/boost/fusion/view/zip_view/detail/next_impl.hpp b/include/boost/fusion/view/zip_view/detail/next_impl.hpp index e9236b42..4bcd90a5 100644 --- a/include/boost/fusion/view/zip_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/next_impl.hpp @@ -42,14 +42,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::next(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -72,7 +72,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Iterator::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp index aa692295..655b5092 100644 --- a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp @@ -41,14 +41,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::prior(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -71,7 +71,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Iterator::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) diff --git a/include/boost/fusion/view/zip_view/zip_view.hpp b/include/boost/fusion/view/zip_view/zip_view.hpp index 4e807f73..cf6f6d27 100644 --- a/include/boost/fusion/view/zip_view/zip_view.hpp +++ b/include/boost/fusion/view/zip_view/zip_view.hpp @@ -122,7 +122,7 @@ namespace boost { namespace fusion { typedef typename fusion::result_of::as_vector::type sequences; typedef typename detail::min_size::type size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED zip_view( const Sequences& seqs) : sequences_(seqs) diff --git a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp index 16b2ca74..cf2d7630 100644 --- a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp +++ b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion { typedef Traversal category; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED zip_view_iterator( const InitSeq& iterator_seq) : iterators_(iterator_seq) diff --git a/preprocess/wave.cfg b/preprocess/wave.cfg index 3fd87116..b88198d7 100644 --- a/preprocess/wave.cfg +++ b/preprocess/wave.cfg @@ -8,10 +8,12 @@ -DBOOST_FUSION_CREATE_PREPROCESSED_FILES -D_WIN32 -D_M_IX86 +-NBOOST_CLANG -NBOOST_STATIC_ASSERT -NBOOST_FORCEINLINE -NBOOST_CONSTEXPR -NBOOST_CXX14_CONSTEXPR +-NBOOST_NOEXCEPT -NBOOST_NO_CXX11_RVALUE_REFERENCES -NBOOST_MPL_ASSERT -NBOOST_MPL_ASSERT_MSG diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index d4f4a8c2..265cfca5 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -38,18 +38,21 @@ namespace ns { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -58,17 +61,22 @@ namespace ns friend struct boost::fusion::extension::access; public: - point_with_private_members() : x(0), y(0) {} - point_with_private_members(int x, int y) : x(x), y(y) {} - - private: + point_with_private_members() : x(0), y(0), z(0) {} + point_with_private_members(int in_x, int in_y, int in_z) + : x(in_x), y(in_y), z(in_z) {} + int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } - + void set_z(int z_) { z = z_; } + + private: + int x; int y; + int z; }; #endif @@ -91,26 +99,56 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ADT( - ns::point, - (int, int, obj.get_x(), obj.set_x(val)) - (int, int, obj.get_y(), obj.set_y(val)) -) +#if BOOST_PP_VARIADICS + 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)) + (obj.get_z(), obj.set_z(val)) + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_ADT( + ns::point_with_private_members, + (obj.get_x(), obj.set_x(val)) + (obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) + ) +# endif + + + BOOST_FUSION_ADAPT_ADT( + ns::name, + (obj.get_last(), obj.set_last(val)) + (obj.get_first(), obj.set_first(val)) + ) + + +#else // BOOST_PP_VARIADICS + 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)) + ) + +# 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)) + ) +# 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)) + ) -#if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_ADT( - ns::point_with_private_members, - (int, int, obj.get_x(), obj.set_x(val)) - (int, int, obj.get_y(), obj.set_y(val)) -) #endif -BOOST_FUSION_ADAPT_ADT( - ns::name, - (const std::string&, const std::string&, obj.get_last(), obj.set_last(val)) - (const std::string&, const std::string&, obj.get_first(), obj.set_first(val)) -) - int main() { @@ -123,28 +161,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p(123, 456); + ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point v2(5, 3); - fusion::vector v3(5, 4); + fusion::vector v1(4, 2, 2); + ns::point v2(5, 3, 3); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -171,15 +211,15 @@ main() { // conversion from ns::point to vector - ns::point p(5, 3); - fusion::vector v(p); + ns::point p(5, 3, 3); + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p(5, 3); - fusion::list l(p); + ns::point p(5, 3, 3); + fusion::list l(p); l = p; } @@ -193,26 +233,29 @@ main() #if !BOOST_WORKAROUND(__GNUC__,<4) { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point_with_private_members p(123, 456); + ns::point_with_private_members p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } #endif { + // Check types provided in case it's provided BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::front::type, @@ -233,6 +276,28 @@ main() boost::fusion::result_of::front::type::type, int >)); + + // Check types provided in case it's deduced + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type, + boost::fusion::extension::adt_attribute_proxy + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type::type, + int + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type, + boost::fusion::extension::adt_attribute_proxy + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type::type, + const int + >)); } return boost::report_errors(); diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 38415633..8924ce41 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -37,28 +37,46 @@ namespace ns { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; } +#if BOOST_PP_VARIADICS + // this creates a fusion view: boost::fusion::adapted::point BOOST_FUSION_ADAPT_ADT_NAMED( ns::point, point, - (int, int, obj.obj.get_x(), obj.obj.set_x(val)) - (int, int, obj.obj.get_y(), obj.obj.set_y(val)) + (int, int, obj.get_x(), obj.set_x(val)) + (int, int, obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) ) +#else // BOOST_PP_VARIADICS + +// this creates a fusion view: boost::fusion::adapted::point +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)) +) + +#endif // BOOST_PP_VARIADICS + int main() { @@ -71,31 +89,33 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep(123, 456); + ns::point basep(123, 456, 789); adapted::point p(basep); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point basep(5, 3); + fusion::vector v1(4, 2, 2); + ns::point basep(5, 3, 3); adapted::point v2(basep); - fusion::vector v3(5, 4); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -108,19 +128,19 @@ main() { // conversion from ns::point to vector - ns::point basep(5, 3); + ns::point basep(5, 3, 3); adapted::point p(basep); - fusion::vector v(p); + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point basep(5, 3); + ns::point basep(5, 3, 3); adapted::point p(basep); - fusion::list l(p); + fusion::list l(p); l = p; } diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index c97e84b0..a03605f1 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -26,31 +26,50 @@ namespace ns struct y_member; struct z_member; + struct non_member; + class point { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; } +#if BOOST_PP_VARIADICS + 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) + (obj.get_z(), obj.set_z(val), ns::z_member) ) +#else // BOOST_PP_VARIADICS + +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) +) + +#endif + int main() { @@ -62,28 +81,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p(123, 456); + ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - ns::point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + ns::point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -96,15 +117,15 @@ main() { // conversion from ns::point to vector - ns::point p(5, 3); - boost::fusion::vector v(p); + ns::point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p(5, 3); - boost::fusion::list l(p); + ns::point p(5, 3, 3); + boost::fusion::list l(p); l = p; } @@ -119,15 +140,19 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); - ns::point p(5, 3); + ns::point p(5, 3, 1); BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 1); } return boost::report_errors(); diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index d68d9904..8ef9aa27 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -48,8 +48,8 @@ namespace ns BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( ns::point, point, - (int, int, obj.obj.get_x(), obj.obj.set_x(val), ns::x_member) - (int, int, obj.obj.get_y(), obj.obj.set_y(val), ns::y_member) + (int, int, obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) ) int diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 62574a7e..4cdabb87 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -42,19 +43,33 @@ namespace ns struct x_member; struct y_member; struct z_member; + struct non_member; struct point { int x; int y; + int z; }; } -BOOST_FUSION_ADAPT_ASSOC_STRUCT( - ns::point, - (int, x, ns::x_member) - (int, y, ns::y_member) -) +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_STRUCT( + ns::point, + (x, ns::x_member) + (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) + (int, z, ns::z_member) + ) + +#endif int main() @@ -68,28 +83,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; + ns::point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); + fusion::vector v1(4, 2, 2); + ns::point v2 = {5, 3, 3}; + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -102,15 +119,15 @@ main() { // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); + ns::point p = {5, 3, 3}; + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); + ns::point p = {5, 3, 3}; + fusion::list l(p); l = p; } @@ -118,15 +135,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); - ns::point p = {5, 3}; + ns::point p = {5, 3, 9}; BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 9); } { @@ -134,6 +154,9 @@ main() BOOST_MPL_ASSERT((boost::is_same< boost::fusion::result_of::value_at_c::type , mpl::front::type>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c::type + , mpl::back::type>)); } return boost::report_errors(); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index 15e2124c..8aa600ff 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -26,39 +26,57 @@ namespace ns struct y_member; struct z_member; - template + struct non_member; + + template class point { public: - point() : x(0), y(0) {} - point(X in_x, Y in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(X in_x, Y in_y, Z in_z) : x(in_x), y(in_y), z(in_z) {} X get_x() const { return x; } Y get_y() const { return y; } + Z get_z() const { return z; } void set_x(X x_) { x = x_; } void set_y(Y y_) { y = y_; } + void set_z(Z z_) { z = z_; } private: X x; Y y; + Z z; }; } +#if BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( - (X)(Y), - (ns::point)(X)(Y), + (X)(Y)(Z), + (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) + (obj.get_z(), obj.set_z(val), ns::z_member) ) + +#else // BOOST_PP_VARIADICS +BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( + (X)(Y)(Z), + (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) +) + +#endif int main() { using namespace boost::fusion; - typedef ns::point point; + typedef ns::point point; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -66,28 +84,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p(123, 456); + point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -100,15 +120,15 @@ main() { // conversion from point to vector - point p(5, 3); - boost::fusion::vector v(p); + point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from point to list - point p(5, 3); - boost::fusion::list l(p); + point p(5, 3, 3); + boost::fusion::list l(p); l = p; } @@ -123,15 +143,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, long>)); - point p(5, 3); + point p(5, 3, 1); BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 1); } return boost::report_errors(); diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index a327f9e8..6adcc931 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -39,27 +39,42 @@ namespace ns struct y_member; struct z_member; - template + struct non_member; + + template struct point { X x; Y y; + Z z; }; } -BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), - (int, x, ns::x_member) - (int, y, ns::y_member) -) +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), + (int, x, ns::x_member) + (Y, y, ns::y_member) + (z, ns::z_member) + ) + +#else // BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), + (int, x, ns::x_member) + (Y, y, ns::y_member) + (BOOST_FUSION_ADAPT_AUTO, z, ns::z_member) + ) +#endif int main() { using namespace boost::fusion; - typedef ns::point point; + typedef ns::point point; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -67,28 +82,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p = {123, 456}; + point p = {123, 456, 789.43f}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789.43f)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - vector v1(4, 2); - point v2 = {5, 3}; - vector v3(5, 4); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4.13f); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -101,15 +118,15 @@ main() { // conversion from point to vector - point p = {5, 3}; - vector v(p); + point p = {5, 3, 3}; + vector v(p); v = p; } { // conversion from point to list - point p = {5, 3}; - list l(p); + point p = {5, 3, 3}; + list l(p); l = p; } @@ -117,15 +134,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, float>)); - point p = {5, 3}; + point p = {5, 3, 9}; BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 9); } return boost::report_errors(); diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 012e8e14..c0cd3049 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -38,6 +38,7 @@ namespace ns { int x; int y; + int z; }; #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -48,9 +49,10 @@ namespace ns private: int x; int y; + int z; public: - point_with_private_attributes(int x, int y):x(x),y(y) + point_with_private_attributes(int x, int y, int z):x(x),y(y),z(z) {} }; #endif @@ -67,63 +69,99 @@ namespace ns }; } -BOOST_FUSION_ADAPT_STRUCT( - ns::point, - (int, x) - (int, y) -) +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_STRUCT( + ns::point, + x, + y, + z + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_STRUCT( + ns::point_with_private_attributes, + x, + y, + z + ) +# endif + + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT(s, m) + + BOOST_FUSION_ADAPT_STRUCT( + ns::bar, + foo_.x, // test that adapted members can actually be expressions + y + ) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_STRUCT( + ns::point, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_STRUCT( + ns::point_with_private_attributes, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) +# endif + + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT(s, (BOOST_FUSION_ADAPT_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) + ) -#if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_STRUCT( - ns::point_with_private_attributes, - (int, x) - (int, y) -) #endif -struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT(s, (int, m)) - -BOOST_FUSION_ADAPT_STRUCT( - ns::bar, - (int, foo_.x) // test that adapted members can actually be expressions - (int, y) -) - int main() { using namespace boost::fusion; using namespace boost; + using ns::point; std::cout << tuple_open('['); std::cout << tuple_close(']'); std::cout << tuple_delimiter(", "); { - BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; + BOOST_MPL_ASSERT_NOT((traits::is_view)); + point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -135,16 +173,16 @@ main() } { - // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); + // conversion from point to vector + point p = {5, 3, 3}; + vector v(p); v = p; } { - // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); + // conversion from point to list + point p = {5, 3, 3}; + list l(p); l = p; } @@ -167,12 +205,13 @@ main() #if !BOOST_WORKAROUND(__GNUC__,<4) { - ns::point_with_private_attributes p(123, 456); + ns::point_with_private_attributes p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); } #endif diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index ef859655..aab11d2d 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -37,19 +37,39 @@ namespace ns { int x; int y; + int z; }; } -// this creates a fusion view: boost::fusion::adapted::point -BOOST_FUSION_ADAPT_STRUCT_NAMED( - ns::point, point, - (int, x) - (int, y) -) +#if BOOST_PP_VARIADICS -// this creates a fusion view: ns1::s1 -struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (int, m)) + // this creates a fusion view: boost::fusion::adapted::point + BOOST_FUSION_ADAPT_STRUCT_NAMED( + ns::point, point, + x, + y, + z + ) + + // this creates a fusion view: ns1::s1 + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, m) + +#else // BOOST_PP_VARIADICS + + // this creates a fusion view: boost::fusion::adapted::point + BOOST_FUSION_ADAPT_STRUCT_NAMED( + ns::point, point, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_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)) + +#endif int main() @@ -63,31 +83,33 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep = {123, 456}; + ns::point basep = {123, 456, 789}; adapted::point p(basep); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point p = {5, 3}; + fusion::vector v1(4, 2, 2); + ns::point p = {5, 3, 3}; adapted::point v2(p); - fusion::vector v3(5, 4); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -100,17 +122,17 @@ main() { // conversion from adapted::point to vector - ns::point basep = {5, 3}; + ns::point basep = {5, 3, 3}; adapted::point p(basep); - fusion::vector v(p); + fusion::vector v(p); v = p; } { // conversion from adapted::point to list - ns::point basep = {5, 3}; + ns::point basep = {5, 3, 3}; adapted::point p(basep); - fusion::list l(p); + fusion::list l(p); l = p; } diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index aeb0f721..bbd1d07f 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -39,27 +39,45 @@ namespace ns { public: - point() : x(0), y(0) {} - point(X x_, Y y_) : x(x_), y(y_) {} + point() : x(0), y(0), z(0) {} + point(X x_, Y y_, int z_) : x(x_), y(y_), z(z_) {} X get_x() const { return x; } Y get_y() const { return y; } + int get_z() const { return z; } void set_x(X x_) { x = x_; } void set_y(Y y_) { y = y_; } + void set_z(int z_) { z = z_; } private: X x; Y y; + int z; }; } -BOOST_FUSION_ADAPT_TPL_ADT( - (X)(Y), - (ns::point)(X)(Y), - (X, X, obj.get_x(), obj.set_x(val)) - (Y, Y, obj.get_y(), obj.set_y(val)) -) + +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_ADT( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val)) + (Y, Y, obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) + ) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_ADT( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val)) + (Y, Y, obj.get_y(), obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + ) +#endif int main() @@ -75,28 +93,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p(123, 456); + point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -108,9 +128,9 @@ main() } { - boost::fusion::vector v1("Lincoln", "Abraham"); - name v2("Roosevelt", "Franklin"); - name v3("Roosevelt", "Theodore"); + boost::fusion::vector v1("Lincoln", "Abraham", 3); + name v2("Roosevelt", "Franklin", 3); + name v3("Roosevelt", "Theodore", 3); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -123,15 +143,15 @@ main() { // conversion from point to vector - point p(5, 3); - boost::fusion::vector v(p); + point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from point to list - point p(5, 3); - boost::fusion::list l(p); + point p(5, 3, 3); + boost::fusion::list l(p); l = p; } diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 352cf995..86face6d 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -35,19 +35,40 @@ namespace ns { X x; Y y; + int z; }; } -BOOST_FUSION_ADAPT_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), - (X, x) - (Y, y) -) +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + x, + (BOOST_FUSION_ADAPT_AUTO, y) + (int, z) + ) + + template + struct s { M m; }; + BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), m) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (X, x) + (Y, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) + + template + struct s { M m; }; + BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (BOOST_FUSION_ADAPT_AUTO, m)) + +#endif -template -struct s { M m; }; -BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (M, m)) int main() @@ -62,28 +83,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p = {123, 456}; + point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - vector v1(4, 2); - point v2 = {5, 3}; - vector v3(5, 4); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -96,14 +119,14 @@ main() { // conversion from point to vector - point p = {5, 3}; - vector v(p); + point p = {5, 3, 3}; + vector v(p); v = p; } { // conversion from point to list - point p = {5, 3}; + point p = {5, 3, 3}; list l(p); l = p; }