From 81ff97433d2610fe67e3a54999f00891d1a0f987 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sat, 24 Dec 2022 04:00:22 +0400 Subject: [PATCH 01/24] [pfr_implicit_explicit] Docs [skip ci] --- doc/adapted.qbk | 292 +++++++++++++++++++++++++++++++++++++++++++ doc/fusion.qbk | 12 ++ doc/html/index.html | 6 + doc/organization.qbk | 1 + doc/references.qbk | 2 + 5 files changed, 313 insertions(+) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index d14086196..1269c72c7 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -2,6 +2,7 @@ Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt + Copyright (c) 2022 Denis Mikhailov Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -23,6 +24,13 @@ various data structures, non-intrusively, as full fledged Fusion sequences. #include #include +[caution +You may get compiler errors when your environment doesn't support __boost_pfr_library__ and this +lack of support doesn't detect automatically. If this happens, define macro +`BOOST_FUSION_PFR_ENABLED` as 0 to suppress the inclusion +of __boost_pfr_implicit__ in this module. +] + [section:array Array] This module provides adapters for arrays. Including the module @@ -208,6 +216,84 @@ __boost_tuple_library__ [endsect] +[section:boost_pfr_implicit boost::pfr] + +[caution This module requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +This module provides reflection from `boost::pfr` as fallback when another reflection not found for a passed type, +the module can be used when you want to pass an user defined structure into Fusion, the module more preferable to use than +__adapt_struct__ macro, because the module does not require boilerplate code from an user defined structure. +Note that the module expects a passed type satisfies __simple_aggregate__. + +[heading Header] + + #include + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + struct some_person { // SimpleAggregate + std::string name; + unsigned birth_year = 0; + }; + + some_person val{"Edgar Allan Poe", 1809}; + std::cout << *__begin__(val) << '\n'; + std::cout << *__next__(__begin__(val)) << '\n'; + +[note See __force_pfr_nonreflectable__ or __force_pfr_nonreflectable_tpl__ if your type falsely determines as "reflectable via PFR" and you need to workaround it.] +[note Define macro `BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION` as 0 if you hit by lots of non-effective choices made by implicit reflection and you need to change for explicit reflection. See __boost_pfr_explicit__ for more details.] +[note Define macro `BOOST_FUSION_PFR_ENABLED` as 0 if you get compiler errors when your program includes __adapted__ and you need to suppress the inclusion of __boost_pfr_implicit__ in __adapted__ module.] +[note This module can't adapt a passed type as fully conforming __mpl__ sequences.] + +[heading See also] + +__boost_pfr_library__ + +[endsect] + +[section:boost_pfr_explicit boost::pfr (explicit)] + +[caution This module requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +This module provides reflection from `boost::pfr`. If you want to use the module, you should specify +all reflectable types manually using one of the macro below. The module can't decide to use PFR for a passed type +automatically, unlike __boost_pfr_implicit__. + +[heading Header] + + #include + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + struct some_person { // SimpleAggregate + std::string name; + unsigned birth_year = 0; + }; + __force_pfr_reflectable__(some_person) + + some_person val{"Edgar Allan Poe", 1809}; + std::cout << *__begin__(val) << '\n'; + std::cout << *__next__(__begin__(val)) << '\n'; + +[note Define macro `BOOST_FUSION_PFR_ENABLED` as 0 if you get compiler errors when your program includes __adapted__ and you need to suppress the inclusion of __boost_pfr_explicit__ in __adapted__ module.] +[note This module can't adapt a passed type as fully conforming __mpl__ sequences.] + +[heading See also] + +__boost_pfr_library__, __force_pfr_reflectable__, __force_pfr_nonreflectable__, __force_pfr_reflectable_tpl__, __force_pfr_nonreflectable_tpl__ + +[endsect] + [section:adapt_struct BOOST_FUSION_ADAPT_STRUCT] [heading Description] @@ -276,6 +362,10 @@ namespace qualified name of the struct to be adapted. (auto, age) ) +[heading See also] + +__boost_pfr_implicit__ (might be a better alternative to using this macro) + [endsect] [section:adapt_tpl_struct BOOST_FUSION_ADAPT_TPL_STRUCT] @@ -357,6 +447,10 @@ namespace qualified name of the struct to be adapted. age, employment_timestamp) +[heading See also] + +__boost_pfr_implicit__ (might be a better alternative to using this macro) + [endsect] [section:adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED] @@ -1500,4 +1594,202 @@ defined in __random_access_sequence__ and __associative_sequence__. [endsect] +[section:force_pfr_reflectable BOOST_FUSION_FORCE_PFR_REFLECTABLE] + +[caution This macro requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +[heading Description] +BOOST_FUSION_FORCE_PFR_REFLECTABLE is a macro that can be used to specify an +arbitrary struct as a pfr-reflectable type for Fusion, and thus to make the struct +possible to be a model of __random_access_sequence__. +The macro intended to be used with __boost_pfr_explicit_adapter__, when you don't need __boost_pfr_implicit_adapter__. + +[heading Synopsis] + BOOST_FUSION_FORCE_PFR_REFLECTABLE(aggregate_name) + +[heading Semantics] + +The above macro specializes `boost::pfr::is_reflectable` for `aggregate_name` with `boost::pfr::boost_fusion_tag` as positive. + +The macro should be used at global scope, and `aggregate_name` should be the fully +namespace qualified name of the struct satisfied __simple_aggregate__ to be specifyed. + +[heading Header] + + #include + #include + #include + #include + +[heading Example: BOOST_FUSION_FORCE_PFR_REFLECTABLE ] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + // demo::employee is now a pfr-reflectable type for Fusion + BOOST_FUSION_FORCE_PFR_REFLECTABLE(demo::employee) + +[note This macro affects only Fusion, see PFR docs if you want to know how to specify type as pfr-reflectable everywhere.] + +[heading See also] + +__boost_pfr_library__ + +[endsect] + +[section:force_pfr_nonreflectable BOOST_FUSION_FORCE_PFR_NONREFLECTABLE] + +[caution This macro requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +[heading Description] +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE is a macro that can be used to declare a Fusion-side prohibition +for an arbitrary struct to be pfr-reflectable, and thus to make the struct +impossible to be a model of fusion sequence. +The macro intended to be used with __boost_pfr_implicit_adapter__, when you need to workaround erroneous +decision that defines a type as pfr-reflectable. + +[heading Synopsis] + BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(type_name) + +[heading Semantics] + +The above macro specializes `boost::pfr::is_reflectable` for `type_name` with `boost::pfr::boost_fusion_tag` as negative. + +The macro should be used at global scope, and `type_name` should be the fully +namespace qualified name of any type that you wish to be specifyed. + +[heading Header] + + #include + #include + #include + #include + +[heading Example: BOOST_FUSION_FORCE_PFR_NONREFLECTABLE ] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + // demo::employee is now forbidden to be a pfr-reflectable type for Fusion + BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(demo::employee) + +[note This macro affects only Fusion, see PFR docs if you want to know how to forbid pfr-reflection for a type everywhere.] + +[heading See also] + +__boost_pfr_library__ + +[endsect] + +[section:force_pfr_reflectable_tpl BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL] + +[caution This macro requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +[heading Description] +BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL is a macro that can be used to specify an +arbitrary template struct as a pfr-reflectable type for Fusion, and thus to make the struct +possible to be a model of __random_access_sequence__. +The macro intended to be used with __boost_pfr_explicit_adapter__, when you don't need __boost_pfr_implicit_adapter__. + +[heading Synopsis] + BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL(aggregate_name) + +[heading Semantics] + +The above macro specializes `boost::pfr::is_reflectable` for `aggregate_name` with `boost::pfr::boost_fusion_tag` as positive. + +The macro should be used at global scope, and `aggregate_name` should be the fully +namespace qualified name of the template struct satisfied __simple_aggregate__ to be specifyed. + +[heading Header] + + #include + #include + #include + #include + +[heading Example: BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL ] + namespace demo + { + template + struct employee + { + Name name; + Age age; + int employment_timestamp; + }; + } + + // Any instantiated demo::employee is now a pfr-reflectable type for Fusion + BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL(demo::employee) + +[note This macro affects only Fusion, see PFR docs if you want to know how to specify type as pfr-reflectable everywhere.] + +[heading See also] + +__boost_pfr_library__ + +[endsect] + +[section:force_pfr_nonreflectable_tpl BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL] + +[caution This macro requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported.] + +[heading Description] +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL is a macro that can be used to declare a Fusion-side prohibition +for an arbitrary template struct to be pfr-reflectable, and thus to make the struct +impossible to be a model of fusion sequence. +The macro intended to be used with __boost_pfr_implicit_adapter__, when you need to workaround erroneous +decision that defines a type as pfr-reflectable. + +[heading Synopsis] + BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL(type_name) + +[heading Semantics] + +The above macro specializes `boost::pfr::is_reflectable` for `type_name` with `boost::pfr::boost_fusion_tag` as negative. + +The macro should be used at global scope, and `type_name` should be the fully +namespace qualified name of any type that you wish to be specifyed. + +[heading Header] + + #include + #include + #include + #include + +[heading Example: BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL ] + namespace demo + { + template + struct employee + { + Name name; + Age age; + int employment_timestamp; + }; + } + + // Any instantiated demo::employee is now forbidden to be a pfr-reflectable type for Fusion + BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL(demo::employee) + +[note This macro affects only Fusion, see PFR docs if you want to know how to forbid pfr-reflection for a type everywhere.] + +[heading See also] + +__boost_pfr_library__ + +[endsect] + [endsect] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index f7a5bf766..e10829f3c 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -48,6 +48,8 @@ [def __boost_func_forward__ [@http://www.boost.org/libs/functional/forward Boost.Functional/Forward Library]] [def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory Boost.Functional/Factory Library]] [def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.ContainerHash Library]] +[def __boost_pfr_library__ [@http://www.boost.org/doc/html/boost_pfr.html Boost.PFR Library]] +[def __simple_aggregate__ [@http://www.boost.org/doc/html/boost_pfr/limitations_and_configuration.html SimpleAggregate]] [def __std_pair_doc__ [@http://en.cppreference.com/w/cpp/utility/pair `std::pair`]] [def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]] [def __std_plus_doc__ [@http://en.cppreference.com/w/cpp/utility/functional/plus `std::plus`]] @@ -132,11 +134,17 @@ [def __flatten_view__ [link fusion.view.flatten_view `flatten_view`]] [def __identity_view__ [link fusion.view.identity_view `identity_view`]] +[def __adapted__ [link fusion.adapted Adapted]] [def __array__ [link fusion.adapted.array array]] [def __std_pair__ [link fusion.adapted.std__pair `std::pair`]] [def __boost_array__ [link fusion.adapted.boost__array `boost::array`]] +[def __boost_pfr_implicit__ [link fusion.adapted.boost_pfr_implicit `boost::pfr`]] +[def __boost_pfr_explicit__ [link fusion.adapted.boost_pfr_explicit `boost::pfr` (explicit)]] +[def __boost_pfr_implicit_adapter__ [link fusion.adapted.boost_pfr_implicit implicit adapter for `boost::pfr`]] +[def __boost_pfr_explicit_adapter__ [link fusion.adapted.boost_pfr_explicit explicit adapter for `boost::pfr`]] [def __mpl_sequence__ [link fusion.adapted.mpl_sequence mpl sequence]] [def __adapt_tpl_struct__ [link fusion.adapted.adapt_tpl_struct `BOOST_FUSION_ADAPT_TPL_STRUCT`]] +[def __adapt_struct__ [link fusion.adapted.adapt_struct `BOOST_FUSION_ADAPT_STRUCT`]] [def __adapt_struct_named__ [link fusion.adapted.adapt_struct_named `BOOST_FUSION_ADAPT_STRUCT_NAMED`]] [def __adapt_struct_named_ns__ [link fusion.adapted.adapt_struct_named `BOOST_FUSION_ADAPT_STRUCT_NAMED_NS`]] [def __adapt_assoc_tpl_struct__ [link fusion.adapted.adapt_assoc_tpl_struct `BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT`]] @@ -150,6 +158,10 @@ [def __define_tpl_struct__ [link fusion.adapted.define_tpl_struct `BOOST_FUSION_DEFINE_TPL_STRUCT`]] [def __define_assoc_struct__ [link fusion.adapted.define_assoc_struct `BOOST_FUSION_DEFINE_ASSOC_STRUCT`]] [def __define_assoc_tpl_struct__ [link fusion.adapted.define_assoc_tpl_struct `BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT`]] +[def __force_pfr_reflectable__ [link fusion.adapted.force_pfr_reflectable `BOOST_FUSION_FORCE_PFR_REFLECTABLE`]] +[def __force_pfr_nonreflectable__ [link fusion.adapted.force_pfr_nonreflectable `BOOST_FUSION_FORCE_PFR_NONREFLECTABLE`]] +[def __force_pfr_reflectable_tpl__ [link fusion.adapted.force_pfr_reflectable_tpl `BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL`]] +[def __force_pfr_nonreflectable_tpl__ [link fusion.adapted.force_pfr_nonreflectable_tpl `BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL`]] [def __intrinsic__ [link fusion.sequence.intrinsic Intrinsic]] [def __intrinsics__ [link fusion.sequence.intrinsic Intrinsics]] diff --git a/doc/html/index.html b/doc/html/index.html index 9f0f14da5..c97b20194 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -176,6 +176,8 @@
mpl sequence
boost::array
boost::tuple
+
boost::pfr
+
boost::pfr (explicit)
BOOST_FUSION_ADAPT_STRUCT
BOOST_FUSION_ADAPT_TPL_STRUCT
BOOST_FUSION_ADAPT_STRUCT_NAMED
@@ -192,6 +194,10 @@
BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE
BOOST_FUSION_DEFINE_ASSOC_STRUCT
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT
+
BOOST_FUSION_FORCE_PFR_REFLECTABLE
+
BOOST_FUSION_FORCE_PFR_NONREFLECTABLE
+
BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL
+
BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL
Algorithm
diff --git a/doc/organization.qbk b/doc/organization.qbk index b062e6ed8..248b59d77 100644 --- a/doc/organization.qbk +++ b/doc/organization.qbk @@ -45,6 +45,7 @@ link against. * array * boost::array * boost::tuple + * boost::pfr * mpl * std_pair * std_tuple diff --git a/doc/references.qbk b/doc/references.qbk index a07815d49..54224e6fe 100644 --- a/doc/references.qbk +++ b/doc/references.qbk @@ -23,6 +23,8 @@ Jaakko Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002. # [@http://www.boost.org/libs/hana The Boost Hana Library], Louis Dionne, 2017. +# [@http://www.boost.org/libs/pfr The Boost PFR Library], + Antony Polukhin, 2016-2022. [endsect] From 45d9be99ac9a3bfc690bf36f8f4968120b956ff5 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 06:56:24 +0400 Subject: [PATCH 02/24] [pfr_implicit_explicit] Add important notes for the docs [skip ci] --- doc/adapted.qbk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 1269c72c7..d36c8b3e5 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -28,7 +28,14 @@ various data structures, non-intrusively, as full fledged Fusion sequences. You may get compiler errors when your environment doesn't support __boost_pfr_library__ and this lack of support doesn't detect automatically. If this happens, define macro `BOOST_FUSION_PFR_ENABLED` as 0 to suppress the inclusion -of __boost_pfr_implicit__ in this module. +of __boost_pfr_implicit_adapter__ and __boost_pfr_explicit_adapter__ in this module. +] + +[caution +You may get compiler errors when your program utilizes __tag_of__, __is_sequence__ or +__is_view__ with an incomplete type. If this happens, define macro +`BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION` as 0 to suppress the inclusion +of __boost_pfr_implicit_adapter__ in this module. ] [section:array Array] @@ -246,7 +253,7 @@ Note that the module expects a passed type satisfies __simple_aggregate__. std::cout << *__next__(__begin__(val)) << '\n'; [note See __force_pfr_nonreflectable__ or __force_pfr_nonreflectable_tpl__ if your type falsely determines as "reflectable via PFR" and you need to workaround it.] -[note Define macro `BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION` as 0 if you hit by lots of non-effective choices made by implicit reflection and you need to change for explicit reflection. See __boost_pfr_explicit__ for more details.] +[note Define macro `BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION` as 0 if you hit by lots of non-effective choices made by implicit reflection(or if you even hit by compiler errors, when your program utilizes __tag_of__, __is_sequence__ or __is_view__ with an incomplete type) and you need to change for explicit reflection. See __boost_pfr_explicit__ for more details.] [note Define macro `BOOST_FUSION_PFR_ENABLED` as 0 if you get compiler errors when your program includes __adapted__ and you need to suppress the inclusion of __boost_pfr_implicit__ in __adapted__ module.] [note This module can't adapt a passed type as fully conforming __mpl__ sequences.] From d002a70b7a24ce993e8de545bb265810621043b8 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 08:11:54 +0400 Subject: [PATCH 03/24] [pfr_implicit_explicit] Add Boost PFR implicit and explicit adapters --- include/boost/fusion/adapted.hpp | 8 ++ include/boost/fusion/adapted/boost_pfr.hpp | 24 ++++ .../adapted/boost_pfr/boost_pfr_iterator.hpp | 108 ++++++++++++++++++ .../adapted/boost_pfr/detail/at_impl.hpp | 47 ++++++++ .../adapted/boost_pfr/detail/begin_impl.hpp | 43 +++++++ .../boost_pfr/detail/category_of_impl.hpp | 33 ++++++ .../adapted/boost_pfr/detail/end_impl.hpp | 45 ++++++++ .../boost_pfr/detail/is_sequence_impl.hpp | 32 ++++++ .../adapted/boost_pfr/detail/is_view_impl.hpp | 41 +++++++ .../adapted/boost_pfr/detail/size_impl.hpp | 36 ++++++ .../boost_pfr/detail/value_at_impl.hpp | 34 ++++++ .../boost/fusion/adapted/boost_pfr/force.hpp | 59 ++++++++++ .../boost/fusion/adapted/boost_pfr/tag_of.hpp | 36 ++++++ .../adapted/boost_pfr/tag_of_fallback.hpp | 41 +++++++ .../fusion/adapted/boost_pfr_explicit.hpp | 24 ++++ include/boost/fusion/include/boost_pfr.hpp | 14 +++ .../fusion/include/boost_pfr_explicit.hpp | 14 +++ include/boost/fusion/support/config.hpp | 10 ++ 18 files changed, 649 insertions(+) create mode 100644 include/boost/fusion/adapted/boost_pfr.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/force.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/tag_of.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp create mode 100644 include/boost/fusion/adapted/boost_pfr_explicit.hpp create mode 100644 include/boost/fusion/include/boost_pfr.hpp create mode 100644 include/boost/fusion/include/boost_pfr_explicit.hpp diff --git a/include/boost/fusion/adapted.hpp b/include/boost/fusion/adapted.hpp index 5bc33899c..5f11f235d 100644 --- a/include/boost/fusion/adapted.hpp +++ b/include/boost/fusion/adapted.hpp @@ -23,4 +23,12 @@ #include #endif +#if BOOST_FUSION_PFR_ENABLED +#if BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION +#include #endif +#include +#endif + +#endif + diff --git a/include/boost/fusion/adapted/boost_pfr.hpp b/include/boost/fusion/adapted/boost_pfr.hpp new file mode 100644 index 000000000..153e5c99d --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp b/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp new file mode 100644 index 000000000..c82985153 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp @@ -0,0 +1,108 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_ITERATOR_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_ITERATOR_HPP + +#include +#include +#include +#include +#include +#include +#include // for std::add_const_t, std::remove_const_t, std::is_same + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + template + struct pfr_iterator_identity; + + template + struct boost_pfr_iterator + : iterator_facade< + boost_pfr_iterator + , random_access_traversal_tag> + { + static_assert(Index >=0 && Index <= boost::pfr::tuple_size_v, "out of range"); + using reflectable_type = Reflectable; + using identity = pfr_iterator_identity, Index>; + + static constexpr auto index = Index; + + constexpr BOOST_FUSION_GPU_ENABLED + explicit boost_pfr_iterator(Reflectable& reflectable) noexcept + : reflectable(reflectable) {} + + Reflectable& reflectable; + + template + struct value_of + : boost::pfr::tuple_element> {}; + + template + struct deref + { + using type = decltype(boost::pfr::get( + std::declval().reflectable)); + static_assert(std::is_reference::value, "internal error"); + + constexpr BOOST_FUSION_GPU_ENABLED + static decltype(auto) + call(Iterator const& iter) noexcept + { + return boost::pfr::get(iter.reflectable); + } + }; + + template + struct advance + { + static constexpr auto index = Iterator::index; + using reflectable_type = typename Iterator::reflectable_type; + using type = boost_pfr_iterator; + + constexpr BOOST_FUSION_GPU_ENABLED + static auto + call(Iterator const& i) noexcept + { + return type(i.reflectable); + } + }; + + template + struct next : advance> {}; + + template + struct prior : advance> {}; + + template + struct equal_to : mpl::bool_ + ::value> + { + }; + + template + struct distance + { + using type = mpl::int_; + + constexpr BOOST_FUSION_GPU_ENABLED + static auto + call(First const&, Last const&) noexcept + { + return type(); + } + }; + }; +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_ITERATOR_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp new file mode 100644 index 000000000..22f881954 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_AT_IMPL_HPP + +#include +#include +#include // for std::declval +#include +#include // for std::is_reference + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + using type = decltype(boost::pfr::get( + std::declval())); + static_assert(std::is_reference::value, "internal error"); + + constexpr BOOST_FUSION_GPU_ENABLED + static decltype(auto) + call(Reflectable& seq) noexcept + { + return boost::pfr::get(seq); + } + }; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_AT_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp new file mode 100644 index 000000000..1425c1547 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_BEGIN_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_BEGIN_IMPL_HPP + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + using type = boost_pfr_iterator; + + constexpr BOOST_FUSION_GPU_ENABLED + static auto + call(Reflectable& v) noexcept + { + return type(v); + } + }; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_BEGIN_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp new file mode 100644 index 000000000..d9b1bfaeb --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_CATEGORY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_CATEGORY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply : mpl::identity {}; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_CATEGORY_OF_IMPL_HPP + + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp new file mode 100644 index 000000000..db5f645cb --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_END_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_END_IMPL_HPP + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct end_impl; + + template<> + struct end_impl + { + template + struct apply + { + static constexpr auto size = boost::pfr::tuple_size_v; + using type = boost_pfr_iterator; + + constexpr BOOST_FUSION_GPU_ENABLED + static auto + call(Reflectable& v) noexcept + { + return type(v); + } + }; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_END_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp new file mode 100644 index 000000000..fbaa752d5 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_IS_SEQUENCE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_IS_SEQUENCE_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_IS_SEQUENCE_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp new file mode 100644 index 000000000..8eb158b4e --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_IS_VIEW_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_IS_VIEW_IMPL_HPP + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct is_view_impl; + + // FIXME replace like this after merging of https://github.com/boostorg/pfr/pull/112 + // template<> + // struct is_view_impl + // { + // template + // struct apply : boost::pfr::is_view {}; + // }; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ {}; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_IS_VIEW_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp new file mode 100644 index 000000000..685c7d0be --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_VIEW_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VIEW_IMPL_HPP + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply : mpl::int_< + boost::pfr::tuple_size_v + > {}; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VIEW_IMPL_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp new file mode 100644 index 000000000..96a896a68 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_DETAIL_VALUE_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VALUE_AT_IMPL_HPP + +#include +#include +#include +#include // for std::remove_const_t + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply : boost::pfr::tuple_element> {}; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VALUE_AT_IMPL_HPP \ No newline at end of file diff --git a/include/boost/fusion/adapted/boost_pfr/force.hpp b/include/boost/fusion/adapted/boost_pfr/force.hpp new file mode 100644 index 000000000..8250b16e2 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/force.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_FORCE_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace pfr { + struct boost_fusion_tag; +}} // namespace boost::pfr + +#define BOOST_FUSION_FORCE_PFR_REFLECTABLE(NAME) \ + namespace boost { namespace pfr { \ + template<> struct is_reflectable \ + : std::true_type \ + { \ + }; \ + }} + +#define BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(NAME) \ + namespace boost { namespace pfr { \ + template<> struct is_reflectable \ + : std::false_type \ + { \ + }; \ + }} + +#define BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL(NAME) \ + namespace boost { namespace pfr { \ + template \ + struct is_reflectable, boost::pfr::boost_fusion_tag> \ + : std::true_type \ + { \ + }; \ + }} + +#define BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL(NAME) \ + namespace boost { namespace pfr { \ + template \ + struct is_reflectable, boost::pfr::boost_fusion_tag> \ + : std::false_type \ + { \ + }; \ + }} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP \ No newline at end of file diff --git a/include/boost/fusion/adapted/boost_pfr/tag_of.hpp b/include/boost/fusion/adapted/boost_pfr/tag_of.hpp new file mode 100644 index 000000000..fc5d0decf --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/tag_of.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_TAG_OF_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_HPP + +#include +#include +#include +#include + +namespace boost { namespace pfr { + struct boost_fusion_tag; +}} // namespace boost::pfr + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + struct fusion_sequence_tag; + + namespace traits + { + template + struct tag_of::value>> + { + using type = boost_pfr_tag; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp new file mode 100644 index 000000000..76417f450 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_TAG_OF_FALLBACK_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_FALLBACK_HPP + +#include +#include +#include +#include + +namespace boost { namespace pfr { + struct boost_fusion_tag; +}} // namespace boost::pfr + +namespace boost { namespace fusion +{ + struct boost_pfr_tag; + struct non_fusion_tag; + struct fusion_sequence_tag; + + namespace detail + { + template + struct tag_of_fallback::value>> + { + static constexpr auto possible_pfr = boost::pfr::is_implicitly_reflectable< + T, boost::pfr::boost_fusion_tag>::value; + using type = std::conditional_t<(!std::is_array::value && possible_pfr) + , boost_pfr_tag + , non_fusion_tag + >; + }; + } +}} + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_FALLBACK_HPP + diff --git a/include/boost/fusion/adapted/boost_pfr_explicit.hpp b/include/boost/fusion/adapted/boost_pfr_explicit.hpp new file mode 100644 index 000000000..861afd404 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr_explicit.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_BOOST_PFR_EXPLICIT_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_EXPLICIT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_EXPLICIT_HPP + diff --git a/include/boost/fusion/include/boost_pfr.hpp b/include/boost/fusion/include/boost_pfr.hpp new file mode 100644 index 000000000..2a3f7c0cd --- /dev/null +++ b/include/boost/fusion/include/boost_pfr.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_INCLUDE_BOOST_PFR_HPP +#define BOOST_FUSION_INCLUDE_BOOST_PFR_HPP + +#include +#include + +#endif + diff --git a/include/boost/fusion/include/boost_pfr_explicit.hpp b/include/boost/fusion/include/boost_pfr_explicit.hpp new file mode 100644 index 000000000..f4f1a6a3b --- /dev/null +++ b/include/boost/fusion/include/boost_pfr_explicit.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + 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_INCLUDE_BOOST_PFR_EXPLICIT_HPP +#define BOOST_FUSION_INCLUDE_BOOST_PFR_EXPLICIT_HPP + +#include +#include + +#endif + diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index 7c87adeb9..acebe259d 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #ifndef BOOST_FUSION_GPU_ENABLED @@ -137,4 +138,13 @@ namespace boost { namespace fusion { namespace detail # define BOOST_FUSION_DISABLE_MSVC_WARNING(num) #endif + +#ifndef BOOST_FUSION_PFR_ENABLED +# define BOOST_FUSION_PFR_ENABLED BOOST_PFR_ENABLE_IMPLICIT_REFLECTION +#endif + +#ifndef BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION +# define BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION BOOST_PFR_ENABLED +#endif + #endif From 85be88db76edfc5cd9bb29c7009fbfd5b851dc05 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 09:48:32 +0400 Subject: [PATCH 04/24] [pfr_implicit_explicit] Add regular test for Boost PFR adapter --- test/Jamfile | 4 + test/sequence/boost_pfr.cpp | 188 ++++++++++++++++++++++++++++++ test/sequence/boost_pfr_empty.cpp | 96 +++++++++++++++ 3 files changed, 288 insertions(+) mode change 100755 => 100644 test/Jamfile create mode 100644 test/sequence/boost_pfr.cpp create mode 100644 test/sequence/boost_pfr_empty.cpp diff --git a/test/Jamfile b/test/Jamfile old mode 100755 new mode 100644 index 21944f24e..2f91b41ea --- a/test/Jamfile +++ b/test/Jamfile @@ -74,6 +74,10 @@ project [ run sequence/as_map_assoc.cpp ] [ run sequence/as_set.cpp ] [ run sequence/as_vector.cpp ] + [ run sequence/boost_pfr.cpp : : + : [ requires cxx17_structured_bindings ] ] + [ run sequence/boost_pfr_empty.cpp : : + : [ requires cxx17_structured_bindings ] ] [ run sequence/boost_tuple.cpp ] [ run sequence/boost_tuple_iterator.cpp ] [ run sequence/cons.cpp ] diff --git a/test/sequence/boost_pfr.cpp b/test/sequence/boost_pfr.cpp new file mode 100644 index 000000000..74e445f3d --- /dev/null +++ b/test/sequence/boost_pfr.cpp @@ -0,0 +1,188 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace namespaced_type { + using integer = int; +} + +namespace ns { + struct point { + int x; + int y; + namespaced_type::integer z; + }; + + struct guaranteed_nonconstexpr_string { + std::string value; + explicit guaranteed_nonconstexpr_string(std::string value) : value(std::move(value)) { + std::cout << "mark to ensure nonconstexpr" << std::endl; + } + }; + + inline bool operator== (const guaranteed_nonconstexpr_string& rhs, const guaranteed_nonconstexpr_string& lhs) { + return (rhs.value == lhs.value); + } + + // Testing non-constexpr compatible types + struct employee { + guaranteed_nonconstexpr_string name; + guaranteed_nonconstexpr_string nickname; + }; +} + +struct s { int m; }; + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using ns::point; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + static_assert(!traits::is_view< point >::value, ""); + 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, 789)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + at_c<2>(p) = 12; + + BOOST_TEST(p == make_vector(6, 9, 12)); + + static_assert(boost::fusion::result_of::size::value == 3, ""); + static_assert(!boost::fusion::result_of::empty::value, ""); + static_assert(std::is_same< + boost::fusion::traits::tag_of::type + , boost::fusion::boost_pfr_tag>::value, ""); + static_assert(!boost::fusion::result_of::equal_to::type, + boost::fusion::result_of::end::type>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 12); + } + + { + vector v1(4, 2.f, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4., 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from point to vector + point p = {5, 3, 3}; + vector v(p); + v = p; + } + + { + // conversion from point to list + point p = {5, 3, 3}; + list l(p); + l = p; + } + + { // begin/end + using namespace boost::fusion; + using boost::is_same; + + using b = boost::fusion::result_of::begin::type; + using e = boost::fusion::result_of::end::type; + // this fails + static_assert(is_same::type, e>::value); + } + + { + // FIXME + // mpl binding, it's possible after resolving https://github.com/boostorg/mpl/issues/71 + //static_assert(boost::mpl::is_sequence::value); + //static_assert(boost::is_same< + // boost::fusion::result_of::value_at_c::type + // , boost::mpl::front::type>::value); + } + + { + ns::employee emp{ns::guaranteed_nonconstexpr_string("John Doe"), + ns::guaranteed_nonconstexpr_string("jdoe")}; + std::cout << at_c<0>(emp).value << std::endl; + std::cout << at_c<1>(emp).value << std::endl; + + fusion::vector v1( + ns::guaranteed_nonconstexpr_string("John Doe"), ns::guaranteed_nonconstexpr_string("jdoe")); + BOOST_TEST(emp == v1); + } + + { + int a[3] = {100, 200, 300}; + static_assert(std::is_same< + boost::fusion::traits::tag_of::type + , boost::fusion::non_fusion_tag>::value, ""); + } + + { + using seq = ns::point; + using c_vec = const ns::point; + using first = boost::fusion::result_of::begin::type; + using c_first = boost::fusion::result_of::begin::type; + + static_assert(boost::is_same::type, int>::value); + static_assert(boost::is_same::type, int>::value); + } + + { + using seq = ns::point; + using c_vec = const ns::point; + + BOOST_MPL_ASSERT((boost::is_same >::type, int>)); + BOOST_MPL_ASSERT((boost::is_same >::type, int>)); + } + + return boost::report_errors(); +} + + diff --git a/test/sequence/boost_pfr_empty.cpp b/test/sequence/boost_pfr_empty.cpp new file mode 100644 index 000000000..a9ab59483 --- /dev/null +++ b/test/sequence/boost_pfr_empty.cpp @@ -0,0 +1,96 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct empty_struct {}; + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view)); + BOOST_STATIC_ASSERT(!traits::is_view::value); + empty_struct e; + + std::cout << e << std::endl; + BOOST_TEST(e == make_vector()); + + BOOST_STATIC_ASSERT(fusion::result_of::size::value == 0); + BOOST_MPL_ASSERT((fusion::result_of::empty)); + + BOOST_MPL_ASSERT((fusion::result_of::equal_to< + fusion::result_of::begin::type, + fusion::result_of::end::type>)); + } + + { + int counter = 0; + empty_struct empty; + boost::fusion::for_each(empty, [&](){counter+=1;}); + BOOST_TEST(counter == 0); + } + + { + fusion::vector<> v; + empty_struct e; + BOOST_TEST(v == e); + BOOST_TEST_NOT(e != v); + BOOST_TEST_NOT(v < e); + BOOST_TEST(v <= e); + BOOST_TEST_NOT(e > v); + BOOST_TEST(e >= v); + } + + { + empty_struct e; + + // conversion from empty_struct to vector + fusion::vector<> v(e); + v = e; + + // FIXME + // conversion from empty_struct to list + //fusion::list<> l(e); + //l = e; + } + + // FIXME + // mpl binding, it's possible after resolving https://github.com/boostorg/mpl/issues/71 + // BOOST_MPL_ASSERT((mpl::is_sequence)); + + return boost::report_errors(); +} + From e26c017e1b728c37ffec7c888e92ffa95353940f Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 10:03:55 +0400 Subject: [PATCH 05/24] [pfr_implicit_explicit] Add test for Boost PFR explicit adapter && fixed typo in the doc --- doc/adapted.qbk | 4 +- test/Jamfile | 2 + test/sequence/boost_pfr_explicit.cpp | 98 ++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 test/sequence/boost_pfr_explicit.cpp diff --git a/doc/adapted.qbk b/doc/adapted.qbk index d36c8b3e5..89d2e6912 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -1619,7 +1619,7 @@ The macro intended to be used with __boost_pfr_explicit_adapter__, when you don' The above macro specializes `boost::pfr::is_reflectable` for `aggregate_name` with `boost::pfr::boost_fusion_tag` as positive. The macro should be used at global scope, and `aggregate_name` should be the fully -namespace qualified name of the struct satisfied __simple_aggregate__ to be specifyed. +namespace qualified name of the struct satisfying __simple_aggregate__ to be specifyed. [heading Header] @@ -1716,7 +1716,7 @@ The macro intended to be used with __boost_pfr_explicit_adapter__, when you don' The above macro specializes `boost::pfr::is_reflectable` for `aggregate_name` with `boost::pfr::boost_fusion_tag` as positive. The macro should be used at global scope, and `aggregate_name` should be the fully -namespace qualified name of the template struct satisfied __simple_aggregate__ to be specifyed. +namespace qualified name of the template struct satisfying __simple_aggregate__ to be specifyed. [heading Header] diff --git a/test/Jamfile b/test/Jamfile index 2f91b41ea..bcad99940 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -78,6 +78,8 @@ project : [ requires cxx17_structured_bindings ] ] [ run sequence/boost_pfr_empty.cpp : : : [ requires cxx17_structured_bindings ] ] + [ run sequence/boost_pfr_explicit.cpp : : + : [ requires cxx14_constexpr ] ] [ run sequence/boost_tuple.cpp ] [ run sequence/boost_tuple_iterator.cpp ] [ run sequence/cons.cpp ] diff --git a/test/sequence/boost_pfr_explicit.cpp b/test/sequence/boost_pfr_explicit.cpp new file mode 100644 index 000000000..e67a287d1 --- /dev/null +++ b/test/sequence/boost_pfr_explicit.cpp @@ -0,0 +1,98 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct just_point { + int x; + int y; + int z; +}; + +struct point_declared_as_reflectable { + int x; + int y; + int z; +}; +BOOST_FUSION_FORCE_PFR_REFLECTABLE(point_declared_as_reflectable) + +// Make sure tag_of can be used with an incomplete type, and explicit adapter for Boost PFR won't broke this +struct incomplete; +typedef boost::fusion::traits::tag_of::type Tag; +BOOST_STATIC_ASSERT((boost::is_same::value)); + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + static_assert(std::is_same< + boost::fusion::traits::tag_of::type + , boost::fusion::non_fusion_tag>::value, ""); + } + + { + using point = point_declared_as_reflectable; + static_assert(!traits::is_view< point >::value, ""); + 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, 789)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + at_c<2>(p) = 12; + + BOOST_TEST(p == make_vector(6, 9, 12)); + + static_assert(boost::fusion::result_of::size::value == 3, ""); + static_assert(!boost::fusion::result_of::empty::value, ""); + static_assert(std::is_same< + boost::fusion::traits::tag_of::type + , boost::fusion::boost_pfr_tag>::value, ""); + static_assert(!boost::fusion::result_of::equal_to::type, + boost::fusion::result_of::end::type>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 12); + } + + return boost::report_errors(); +} + + From e5b23443ec2e735ccfaa1d1030923d8d6e9eb51c Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 11:00:27 +0400 Subject: [PATCH 06/24] [pfr_implicit_explicit] Just more tests --- test/Jamfile | 13 +++ test/include/_boost_pfr.cpp | 15 +++ test/include/_boost_pfr_explicit.cpp | 15 +++ test/include/adapted.cpp | 15 +++ test/sequence/boost_pfr_convert.cpp | 64 +++++++++++ test/sequence/boost_pfr_force_macro.cpp | 57 ++++++++++ test/sequence/boost_pfr_iterator.cpp | 135 ++++++++++++++++++++++++ test/sequence/convert.hpp | 14 ++- test/support/config.cpp | 18 ++++ 9 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 test/include/_boost_pfr.cpp create mode 100644 test/include/_boost_pfr_explicit.cpp create mode 100644 test/include/adapted.cpp create mode 100644 test/sequence/boost_pfr_convert.cpp create mode 100644 test/sequence/boost_pfr_force_macro.cpp create mode 100644 test/sequence/boost_pfr_iterator.cpp create mode 100644 test/support/config.cpp diff --git a/test/Jamfile b/test/Jamfile index bcad99940..fcdab695e 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -68,6 +68,12 @@ project [ run algorithm/flatten.cpp ] [ compile algorithm/ticket-5490.cpp ] + [ compile include/adapted.cpp ] + [ compile include/_boost_pfr.cpp + : [ requires cxx17_structured_bindings ] ] + [ compile include/_boost_pfr_explicit.cpp + : [ requires cxx14_constexpr ] ] + [ run sequence/as_deque.cpp ] [ run sequence/as_list.cpp ] [ run sequence/as_map.cpp ] @@ -78,6 +84,12 @@ project : [ requires cxx17_structured_bindings ] ] [ run sequence/boost_pfr_empty.cpp : : : [ requires cxx17_structured_bindings ] ] + [ run sequence/boost_pfr_convert.cpp : : + : [ requires cxx17_structured_bindings ] ] + [ run sequence/boost_pfr_iterator.cpp : : + : [ requires cxx14_constexpr ] ] + [ run sequence/boost_pfr_force_macro.cpp : : + : [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_explicit.cpp : : : [ requires cxx14_constexpr ] ] [ run sequence/boost_tuple.cpp ] @@ -263,6 +275,7 @@ project [ run functional/invoke_procedure.cpp ] [ run sequence/swap.cpp ] + [ run support/config.cpp ] [ compile support/is_sequence.cpp ] [ compile support/is_view.cpp ] [ compile support/pair_deque.cpp ] diff --git a/test/include/_boost_pfr.cpp b/test/include/_boost_pfr.cpp new file mode 100644 index 000000000..460fe9cde --- /dev/null +++ b/test/include/_boost_pfr.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include + +int +main() +{ + return boost::report_errors(); +} + diff --git a/test/include/_boost_pfr_explicit.cpp b/test/include/_boost_pfr_explicit.cpp new file mode 100644 index 000000000..460fe9cde --- /dev/null +++ b/test/include/_boost_pfr_explicit.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include + +int +main() +{ + return boost::report_errors(); +} + diff --git a/test/include/adapted.cpp b/test/include/adapted.cpp new file mode 100644 index 000000000..c58727e41 --- /dev/null +++ b/test/include/adapted.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include + +int +main() +{ + return boost::report_errors(); +} + diff --git a/test/sequence/boost_pfr_convert.cpp b/test/sequence/boost_pfr_convert.cpp new file mode 100644 index 000000000..4d3603fe6 --- /dev/null +++ b/test/sequence/boost_pfr_convert.cpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +struct SimpleAggregate { + int first; + std::string second; +}; + +template +void test(Seq const& seq) +{ + const auto v = boost::fusion::convert(seq); + BOOST_TEST((boost::fusion::at_c<0>(v) == 123)); + BOOST_TEST((boost::fusion::at_c<1>(v) == "Hola!!!")); +} + +int +main() +{ + SimpleAggregate seq{123, "Hola!!!"}; + test(seq); + test(seq); + test(seq); + test(seq); + test(seq); + return boost::report_errors(); +} + + diff --git a/test/sequence/boost_pfr_force_macro.cpp b/test/sequence/boost_pfr_force_macro.cpp new file mode 100644 index 000000000..3f14e0777 --- /dev/null +++ b/test/sequence/boost_pfr_force_macro.cpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include + +struct not_a_sequence {}; +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(not_a_sequence) + +struct reflectable { + explicit reflectable(int first, int second) {} +}; +BOOST_FUSION_FORCE_PFR_REFLECTABLE(reflectable) + +template +struct not_a_sequence_tpl {}; +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL(not_a_sequence_tpl) + +template +struct reflectable_tpl { + explicit reflectable_tpl(int first, int second) {} +}; +BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL(reflectable_tpl) + + +int +main() +{ + { + using Tag = boost::fusion::traits::tag_of::type; + using Tag2 = boost::fusion::traits::tag_of::type; + using Tag3 = boost::fusion::traits::tag_of>::type; + using Tag4 = boost::fusion::traits::tag_of>::type; + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((!boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((!boost::is_same::value)); + } + { + using Tag = boost::fusion::traits::tag_of::type; + using Tag2 = boost::fusion::traits::tag_of::type; + using Tag3 = boost::fusion::traits::tag_of>::type; + using Tag4 = boost::fusion::traits::tag_of>::type; + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((!boost::is_same::value)); + BOOST_STATIC_ASSERT((boost::is_same::value)); + BOOST_STATIC_ASSERT((!boost::is_same::value)); + } + return boost::report_errors(); +} + + diff --git a/test/sequence/boost_pfr_iterator.cpp b/test/sequence/boost_pfr_iterator.cpp new file mode 100644 index 000000000..f0cebc9bf --- /dev/null +++ b/test/sequence/boost_pfr_iterator.cpp @@ -0,0 +1,135 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct A +{ + int first; + int second; + int third; +}; +BOOST_FUSION_FORCE_PFR_REFLECTABLE(A) + +template +struct is_same_thernary + : std::integral_constant::value && std::is_same::value)> +{ +}; + +int +main() +{ + { + A a{100, 200, 300}; + + using namespace boost::fusion; + + static_assert(is_same_thernary< + boost::fusion::result_of::prior< boost::fusion::result_of::end::type >::type + , std::remove_const_t + , boost_pfr_iterator + >::value); + + BOOST_TEST(*prior(end(a)) == 300); + BOOST_TEST(*next(begin(a)) == 200); + BOOST_TEST(distance(begin(a), end(a)) == 3); + BOOST_TEST(advance< boost::mpl::int_<3> >(begin(a)) == end(a)); + } + + { + A a; // it must be instead of std::declval + const A ca{800, 600, 500}; + + using namespace boost::fusion; + + static_assert(is_same_thernary< + boost::fusion::result_of::deref::type + , decltype(deref(begin(a))) + , int& + >::value); + static_assert(is_same_thernary< + boost::fusion::result_of::deref::type + , decltype(deref(begin(ca))) + , const int& + >::value); + + static_assert(is_same_thernary< + boost::fusion::result_of::deref>(end(a)) )>::type + , decltype(deref(advance>(end(a)))) + , int& + >::value); + static_assert(is_same_thernary< + boost::fusion::result_of::deref>(end(ca)) )>::type + , decltype(deref(advance>(end(ca)))) + , const int& + >::value); + } + + { + A a; // it must be instead of std::declval + const A ca{800, 600, 500}; + + using namespace boost::fusion; + + static_assert(is_same_thernary< + boost::fusion::result_of::at_c::type + , decltype(at_c<0>(a)) + , int& + >::value); + static_assert(is_same_thernary< + boost::fusion::result_of::at_c::type + , decltype(at_c<0>(ca)) + , const int& + >::value); + } + + { + A a{100, 200, 300}; + const A ca{800, 600, 500}; + + using namespace boost::fusion; + + static_assert(is_same_thernary< + boost::fusion::result_of::value_of< boost::fusion::result_of::begin::type >::type + , boost::fusion::result_of::value_at< decltype(a), boost::mpl::int_<0> >::type + , int + >::value); + + static_assert(is_same_thernary< + boost::fusion::result_of::value_of< boost::fusion::result_of::begin::type >::type + , boost::fusion::result_of::value_at< decltype(ca), boost::mpl::int_<0> >::type + , int + >::value); + } + + return boost::report_errors(); +} + + diff --git a/test/sequence/convert.hpp b/test/sequence/convert.hpp index 233fabfb3..b60578723 100644 --- a/test/sequence/convert.hpp +++ b/test/sequence/convert.hpp @@ -9,6 +9,8 @@ #include #include #include + +#include #include #include @@ -20,6 +22,13 @@ #include #endif +#if BOOST_FUSION_PFR_ENABLED +#if BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION +#include +#endif +#include +#endif + template void test(FUSION_SEQUENCE const& seq) { @@ -45,7 +54,10 @@ int main() #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) test(seq); #endif - +#if BOOST_FUSION_PFR_ENABLED + // There is no 'convert' for Boost PFR, and it's impossible to implement + //test(seq); +#endif return boost::report_errors(); } diff --git a/test/support/config.cpp b/test/support/config.cpp new file mode 100644 index 000000000..cfd3cf434 --- /dev/null +++ b/test/support/config.cpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2021-2022 Denis Mikhailov + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include + +#include + +int main() { + std::cout << "Platform info:" << '\n' + << "BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION == " << BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION << '\n' + << "BOOST_FUSION_PFR_ENABLED == " << BOOST_FUSION_PFR_ENABLED << '\n' + << "__cplusplus == " << __cplusplus << '\n' + ; +} + From bc1415e613c95d34441fe2284a9c5f671ba70aea Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 11:07:08 +0400 Subject: [PATCH 07/24] [pfr_implicit_explicit] Add pfr dependency --- .github/workflows/ci.yml | 2 ++ CMakeLists.txt | 1 + appveyor.yml | 1 + 3 files changed, 4 insertions(+) mode change 100755 => 100644 .github/workflows/ci.yml mode change 100755 => 100644 CMakeLists.txt mode change 100755 => 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100755 new mode 100644 index 588a60839..e427b06b6 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -346,6 +346,7 @@ jobs: git submodule init libs/utility git submodule init libs/describe git submodule init libs/mp11 + git submodule init libs/pfr git submodule init libs/headers tools/boost_install tools/build git submodule update rm -rf libs/fusion @@ -456,6 +457,7 @@ jobs: git submodule init libs/utility git submodule init libs/describe git submodule init libs/mp11 + git submodule init libs/pfr git submodule init libs/headers tools/boost_install tools/build git submodule update rm -rf libs/fusion diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 89c55ff26..4e12e21e9 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,4 +26,5 @@ target_link_libraries(boost_fusion Boost::functional Boost::describe Boost::mp11 + Boost::pfr ) diff --git a/appveyor.yml b/appveyor.yml old mode 100755 new mode 100644 index 2722b6b6a..5c1ab8d8e --- a/appveyor.yml +++ b/appveyor.yml @@ -84,6 +84,7 @@ install: - git submodule init libs/utility - git submodule init libs/describe - git submodule init libs/mp11 + - git submodule init libs/pfr - git submodule init libs/headers tools/boost_install tools/build - git submodule update From cd54084c4ec5e863e8c57b115b498632344d119a Mon Sep 17 00:00:00 2001 From: denzor200 Date: Fri, 30 Dec 2022 18:10:41 +0400 Subject: [PATCH 08/24] [pfr_implicit_explicit] Fix warning static_assert with no message --- test/sequence/boost_pfr.cpp | 12 ++++++------ test/sequence/boost_pfr_explicit.cpp | 2 +- test/sequence/boost_pfr_iterator.cpp | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/sequence/boost_pfr.cpp b/test/sequence/boost_pfr.cpp index 74e445f3d..7058ecb38 100644 --- a/test/sequence/boost_pfr.cpp +++ b/test/sequence/boost_pfr.cpp @@ -93,7 +93,7 @@ main() boost::fusion::traits::tag_of::type , boost::fusion::boost_pfr_tag>::value, ""); static_assert(!boost::fusion::result_of::equal_to::type, - boost::fusion::result_of::end::type>::value); + boost::fusion::result_of::end::type>::value, ""); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 12); @@ -134,16 +134,16 @@ main() using b = boost::fusion::result_of::begin::type; using e = boost::fusion::result_of::end::type; // this fails - static_assert(is_same::type, e>::value); + static_assert(is_same::type, e>::value, ""); } { // FIXME // mpl binding, it's possible after resolving https://github.com/boostorg/mpl/issues/71 - //static_assert(boost::mpl::is_sequence::value); + //static_assert(boost::mpl::is_sequence::value, ""); //static_assert(boost::is_same< // boost::fusion::result_of::value_at_c::type - // , boost::mpl::front::type>::value); + // , boost::mpl::front::type>::value, ""); } { @@ -170,8 +170,8 @@ main() using first = boost::fusion::result_of::begin::type; using c_first = boost::fusion::result_of::begin::type; - static_assert(boost::is_same::type, int>::value); - static_assert(boost::is_same::type, int>::value); + static_assert(boost::is_same::type, int>::value, ""); + static_assert(boost::is_same::type, int>::value, ""); } { diff --git a/test/sequence/boost_pfr_explicit.cpp b/test/sequence/boost_pfr_explicit.cpp index e67a287d1..af363b308 100644 --- a/test/sequence/boost_pfr_explicit.cpp +++ b/test/sequence/boost_pfr_explicit.cpp @@ -86,7 +86,7 @@ main() boost::fusion::traits::tag_of::type , boost::fusion::boost_pfr_tag>::value, ""); static_assert(!boost::fusion::result_of::equal_to::type, - boost::fusion::result_of::end::type>::value); + boost::fusion::result_of::end::type>::value, ""); BOOST_TEST(front(p) == 6); BOOST_TEST(back(p) == 12); diff --git a/test/sequence/boost_pfr_iterator.cpp b/test/sequence/boost_pfr_iterator.cpp index f0cebc9bf..36ac476f4 100644 --- a/test/sequence/boost_pfr_iterator.cpp +++ b/test/sequence/boost_pfr_iterator.cpp @@ -55,7 +55,7 @@ main() boost::fusion::result_of::prior< boost::fusion::result_of::end::type >::type , std::remove_const_t , boost_pfr_iterator - >::value); + >::value, ""); BOOST_TEST(*prior(end(a)) == 300); BOOST_TEST(*next(begin(a)) == 200); @@ -73,23 +73,23 @@ main() boost::fusion::result_of::deref::type , decltype(deref(begin(a))) , int& - >::value); + >::value, ""); static_assert(is_same_thernary< boost::fusion::result_of::deref::type , decltype(deref(begin(ca))) , const int& - >::value); + >::value, ""); static_assert(is_same_thernary< boost::fusion::result_of::deref>(end(a)) )>::type , decltype(deref(advance>(end(a)))) , int& - >::value); + >::value, ""); static_assert(is_same_thernary< boost::fusion::result_of::deref>(end(ca)) )>::type , decltype(deref(advance>(end(ca)))) , const int& - >::value); + >::value, ""); } { @@ -102,12 +102,12 @@ main() boost::fusion::result_of::at_c::type , decltype(at_c<0>(a)) , int& - >::value); + >::value, ""); static_assert(is_same_thernary< boost::fusion::result_of::at_c::type , decltype(at_c<0>(ca)) , const int& - >::value); + >::value, ""); } { @@ -120,13 +120,13 @@ main() boost::fusion::result_of::value_of< boost::fusion::result_of::begin::type >::type , boost::fusion::result_of::value_at< decltype(a), boost::mpl::int_<0> >::type , int - >::value); + >::value, ""); static_assert(is_same_thernary< boost::fusion::result_of::value_of< boost::fusion::result_of::begin::type >::type , boost::fusion::result_of::value_at< decltype(ca), boost::mpl::int_<0> >::type , int - >::value); + >::value, ""); } return boost::report_errors(); From aed0503b938933c2c93d1e5ec18e88c83fc1ae20 Mon Sep 17 00:00:00 2001 From: Denis Mikhaylov Date: Wed, 11 Jan 2023 16:31:04 +0600 Subject: [PATCH 09/24] [pfr_implicit_explicit] Force pfr implicit reflection in cxx14 mode --- test/Jamfile | 8 ++++---- test/sequence/boost_pfr.cpp | 28 +++++++++++++++++++++------- test/sequence/boost_pfr_convert.cpp | 5 +++-- test/sequence/boost_pfr_empty.cpp | 21 ++++++++++++++------- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index fcdab695e..6fc704f97 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -70,7 +70,7 @@ project [ compile include/adapted.cpp ] [ compile include/_boost_pfr.cpp - : [ requires cxx17_structured_bindings ] ] + : BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 [ requires cxx14_constexpr ] ] [ compile include/_boost_pfr_explicit.cpp : [ requires cxx14_constexpr ] ] @@ -81,11 +81,11 @@ project [ run sequence/as_set.cpp ] [ run sequence/as_vector.cpp ] [ run sequence/boost_pfr.cpp : : - : [ requires cxx17_structured_bindings ] ] + : BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_empty.cpp : : - : [ requires cxx17_structured_bindings ] ] + : BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_convert.cpp : : - : [ requires cxx17_structured_bindings ] ] + : BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_iterator.cpp : : : [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_force_macro.cpp : : diff --git a/test/sequence/boost_pfr.cpp b/test/sequence/boost_pfr.cpp index 7058ecb38..5b7e425fe 100644 --- a/test/sequence/boost_pfr.cpp +++ b/test/sequence/boost_pfr.cpp @@ -52,10 +52,12 @@ namespace ns { } // Testing non-constexpr compatible types +#if BOOST_PFR_USE_CPP17 != 0 struct employee { guaranteed_nonconstexpr_string name; guaranteed_nonconstexpr_string nickname; }; +#endif // BOOST_PFR_USE_CPP17 } struct s { int m; }; @@ -63,13 +65,23 @@ struct s { int m; }; int main() { - using namespace boost::fusion; - using namespace boost; + using boost::fusion::tuple_open; + using boost::fusion::tuple_close; + using boost::fusion::tuple_delimiter; + using boost::fusion::at_c; + using boost::fusion::make_vector; + using boost::fusion::front; + using boost::fusion::back; + using boost::fusion::vector; + using boost::fusion::list; + namespace traits = boost::fusion::traits; + namespace fusion = boost::fusion; using ns::point; - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); + // FIXME make this workable even with forced implicit reflection + // std::cout << tuple_open('['); + // std::cout << tuple_close(']'); + // std::cout << tuple_delimiter(", "); { static_assert(!traits::is_view< point >::value, ""); @@ -78,7 +90,7 @@ main() 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::fusion::out(std::cout, p) << std::endl; BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; @@ -146,9 +158,10 @@ main() // , boost::mpl::front::type>::value, ""); } +#if BOOST_PFR_USE_CPP17 != 0 { ns::employee emp{ns::guaranteed_nonconstexpr_string("John Doe"), - ns::guaranteed_nonconstexpr_string("jdoe")}; + ns::guaranteed_nonconstexpr_string("jdoe")}; std::cout << at_c<0>(emp).value << std::endl; std::cout << at_c<1>(emp).value << std::endl; @@ -156,6 +169,7 @@ main() ns::guaranteed_nonconstexpr_string("John Doe"), ns::guaranteed_nonconstexpr_string("jdoe")); BOOST_TEST(emp == v1); } +#endif // BOOST_PFR_USE_CPP17 { int a[3] = {100, 200, 300}; diff --git a/test/sequence/boost_pfr_convert.cpp b/test/sequence/boost_pfr_convert.cpp index 4d3603fe6..8f246cff4 100644 --- a/test/sequence/boost_pfr_convert.cpp +++ b/test/sequence/boost_pfr_convert.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,7 @@ struct SimpleAggregate { int first; - std::string second; + const char* second; }; template @@ -46,7 +47,7 @@ void test(Seq const& seq) { const auto v = boost::fusion::convert(seq); BOOST_TEST((boost::fusion::at_c<0>(v) == 123)); - BOOST_TEST((boost::fusion::at_c<1>(v) == "Hola!!!")); + BOOST_TEST((std::strcmp(boost::fusion::at_c<1>(v), "Hola!!!") == 0)); } int diff --git a/test/sequence/boost_pfr_empty.cpp b/test/sequence/boost_pfr_empty.cpp index a9ab59483..fba96f7cf 100644 --- a/test/sequence/boost_pfr_empty.cpp +++ b/test/sequence/boost_pfr_empty.cpp @@ -33,19 +33,26 @@ struct empty_struct {}; int main() { - using namespace boost::fusion; - using namespace boost; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); + using boost::fusion::tuple_open; + using boost::fusion::tuple_close; + using boost::fusion::tuple_delimiter; + using boost::fusion::make_vector; + using boost::fusion::vector; + using boost::fusion::list; + namespace traits = boost::fusion::traits; + namespace fusion = boost::fusion; + + // FIXME make this workable even with forced implicit reflection + // std::cout << tuple_open('['); + // std::cout << tuple_close(']'); + // std::cout << tuple_delimiter(", "); { BOOST_MPL_ASSERT_NOT((traits::is_view)); BOOST_STATIC_ASSERT(!traits::is_view::value); empty_struct e; - std::cout << e << std::endl; + boost::fusion::out(std::cout, e) << std::endl; BOOST_TEST(e == make_vector()); BOOST_STATIC_ASSERT(fusion::result_of::size::value == 0); From a7bb2c7b0f9b256fffa317a6fd5a25bc0272cb22 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 15 Jan 2023 22:55:56 +0600 Subject: [PATCH 10/24] [pfr_implicit_explicit] Update copyright years --- doc/adapted.qbk | 2 +- doc/references.qbk | 2 +- include/boost/fusion/adapted/boost_pfr.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp | 2 +- .../fusion/adapted/boost_pfr/detail/category_of_impl.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp | 2 +- .../fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp | 2 +- .../boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp | 2 +- .../boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp | 4 ++-- include/boost/fusion/adapted/boost_pfr/force.hpp | 4 ++-- include/boost/fusion/adapted/boost_pfr/tag_of.hpp | 2 +- include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp | 2 +- include/boost/fusion/adapted/boost_pfr_explicit.hpp | 2 +- include/boost/fusion/include/boost_pfr.hpp | 2 +- include/boost/fusion/include/boost_pfr_explicit.hpp | 2 +- test/include/_boost_pfr.cpp | 2 +- test/include/_boost_pfr_explicit.cpp | 2 +- test/include/adapted.cpp | 2 +- test/sequence/boost_pfr.cpp | 2 +- test/sequence/boost_pfr_convert.cpp | 2 +- test/sequence/boost_pfr_empty.cpp | 2 +- test/sequence/boost_pfr_explicit.cpp | 2 +- test/sequence/boost_pfr_force_macro.cpp | 2 +- test/sequence/boost_pfr_iterator.cpp | 2 +- test/support/config.cpp | 2 +- 28 files changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 89d2e6912..b1d263440 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -2,7 +2,7 @@ Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden Copyright (C) 2010 Christopher Schmidt - Copyright (c) 2022 Denis Mikhailov + Copyright (c) 2023 Denis Mikhailov Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at diff --git a/doc/references.qbk b/doc/references.qbk index 54224e6fe..c5b513f3e 100644 --- a/doc/references.qbk +++ b/doc/references.qbk @@ -24,7 +24,7 @@ # [@http://www.boost.org/libs/hana The Boost Hana Library], Louis Dionne, 2017. # [@http://www.boost.org/libs/pfr The Boost PFR Library], - Antony Polukhin, 2016-2022. + Antony Polukhin, 2016-2023. [endsect] diff --git a/include/boost/fusion/adapted/boost_pfr.hpp b/include/boost/fusion/adapted/boost_pfr.hpp index 153e5c99d..cf97d2ef6 100644 --- a/include/boost/fusion/adapted/boost_pfr.hpp +++ b/include/boost/fusion/adapted/boost_pfr.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp b/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp index c82985153..d827908d8 100644 --- a/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp +++ b/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp index 22f881954..ac9677463 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp index 1425c1547..d94d09fa5 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp index d9b1bfaeb..8bb02e632 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp index db5f645cb..f2c81a9cd 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp index fbaa752d5..bf70f390e 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp index 8eb158b4e..2d53e5685 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp index 685c7d0be..6ba714c0d 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp b/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp index 96a896a68..2a47f2c24 100644 --- a/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp +++ b/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ @@ -31,4 +31,4 @@ namespace boost { namespace fusion } }} -#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VALUE_AT_IMPL_HPP \ No newline at end of file +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_DETAIL_VALUE_AT_IMPL_HPP diff --git a/include/boost/fusion/adapted/boost_pfr/force.hpp b/include/boost/fusion/adapted/boost_pfr/force.hpp index 8250b16e2..51d9e2bc4 100644 --- a/include/boost/fusion/adapted/boost_pfr/force.hpp +++ b/include/boost/fusion/adapted/boost_pfr/force.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ @@ -56,4 +56,4 @@ namespace boost { namespace pfr { }; \ }} -#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP \ No newline at end of file +#endif //BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP diff --git a/include/boost/fusion/adapted/boost_pfr/tag_of.hpp b/include/boost/fusion/adapted/boost_pfr/tag_of.hpp index fc5d0decf..6529b75cb 100644 --- a/include/boost/fusion/adapted/boost_pfr/tag_of.hpp +++ b/include/boost/fusion/adapted/boost_pfr/tag_of.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp index 76417f450..762d7da43 100644 --- a/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp +++ b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/adapted/boost_pfr_explicit.hpp b/include/boost/fusion/adapted/boost_pfr_explicit.hpp index 861afd404..0e31d8065 100644 --- a/include/boost/fusion/adapted/boost_pfr_explicit.hpp +++ b/include/boost/fusion/adapted/boost_pfr_explicit.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/include/boost_pfr.hpp b/include/boost/fusion/include/boost_pfr.hpp index 2a3f7c0cd..d70d91b0c 100644 --- a/include/boost/fusion/include/boost_pfr.hpp +++ b/include/boost/fusion/include/boost_pfr.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/include/boost/fusion/include/boost_pfr_explicit.hpp b/include/boost/fusion/include/boost_pfr_explicit.hpp index f4f1a6a3b..f06f95deb 100644 --- a/include/boost/fusion/include/boost_pfr_explicit.hpp +++ b/include/boost/fusion/include/boost_pfr_explicit.hpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/include/_boost_pfr.cpp b/test/include/_boost_pfr.cpp index 460fe9cde..27402c614 100644 --- a/test/include/_boost_pfr.cpp +++ b/test/include/_boost_pfr.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/include/_boost_pfr_explicit.cpp b/test/include/_boost_pfr_explicit.cpp index 460fe9cde..27402c614 100644 --- a/test/include/_boost_pfr_explicit.cpp +++ b/test/include/_boost_pfr_explicit.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/include/adapted.cpp b/test/include/adapted.cpp index c58727e41..13ed9e027 100644 --- a/test/include/adapted.cpp +++ b/test/include/adapted.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr.cpp b/test/sequence/boost_pfr.cpp index 5b7e425fe..6f6f4aeb9 100644 --- a/test/sequence/boost_pfr.cpp +++ b/test/sequence/boost_pfr.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr_convert.cpp b/test/sequence/boost_pfr_convert.cpp index 8f246cff4..1013f64dc 100644 --- a/test/sequence/boost_pfr_convert.cpp +++ b/test/sequence/boost_pfr_convert.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr_empty.cpp b/test/sequence/boost_pfr_empty.cpp index fba96f7cf..4915e2c9a 100644 --- a/test/sequence/boost_pfr_empty.cpp +++ b/test/sequence/boost_pfr_empty.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr_explicit.cpp b/test/sequence/boost_pfr_explicit.cpp index af363b308..9015c13c7 100644 --- a/test/sequence/boost_pfr_explicit.cpp +++ b/test/sequence/boost_pfr_explicit.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr_force_macro.cpp b/test/sequence/boost_pfr_force_macro.cpp index 3f14e0777..e2099bed0 100644 --- a/test/sequence/boost_pfr_force_macro.cpp +++ b/test/sequence/boost_pfr_force_macro.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/sequence/boost_pfr_iterator.cpp b/test/sequence/boost_pfr_iterator.cpp index 36ac476f4..76b603576 100644 --- a/test/sequence/boost_pfr_iterator.cpp +++ b/test/sequence/boost_pfr_iterator.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ diff --git a/test/support/config.cpp b/test/support/config.cpp index cfd3cf434..b69e731d0 100644 --- a/test/support/config.cpp +++ b/test/support/config.cpp @@ -1,5 +1,5 @@ /*============================================================================= - Copyright (c) 2021-2022 Denis Mikhailov + Copyright (c) 2021-2023 Denis Mikhailov 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) ==============================================================================*/ From 40dfa11a92b0f5eb4d0e69bb843504f005328d44 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 15 Jan 2023 23:36:07 +0600 Subject: [PATCH 11/24] [pfr_implicit_explicit] Fix for 'config.hpp' && Comment for 'adapted.hpp' --- include/boost/fusion/adapted.hpp | 5 +++++ include/boost/fusion/support/config.hpp | 4 ++-- test/Jamfile | 2 ++ test/support/config_pfr_0.cpp | 17 +++++++++++++++++ test/support/config_pfr_1.cpp | 19 +++++++++++++++++++ 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 test/support/config_pfr_0.cpp create mode 100644 test/support/config_pfr_1.cpp diff --git a/include/boost/fusion/adapted.hpp b/include/boost/fusion/adapted.hpp index 5f11f235d..2d983a1c2 100644 --- a/include/boost/fusion/adapted.hpp +++ b/include/boost/fusion/adapted.hpp @@ -23,6 +23,11 @@ #include #endif +// The Boost PFR Library is a C++14 library, but this library also +// may be not supported in some C++14 compilers. +// Even if the library is supported in user's environment, that +// still doesn't mean the environment supports implicit reflection +// and that also doesn't mean the user wants implicit reflection. #if BOOST_FUSION_PFR_ENABLED #if BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION #include diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index acebe259d..3c8e91d54 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -140,11 +140,11 @@ namespace boost { namespace fusion { namespace detail #ifndef BOOST_FUSION_PFR_ENABLED -# define BOOST_FUSION_PFR_ENABLED BOOST_PFR_ENABLE_IMPLICIT_REFLECTION +# define BOOST_FUSION_PFR_ENABLED BOOST_PFR_ENABLED #endif #ifndef BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION -# define BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION BOOST_PFR_ENABLED +# define BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION BOOST_PFR_ENABLE_IMPLICIT_REFLECTION #endif #endif diff --git a/test/Jamfile b/test/Jamfile index 6fc704f97..ba7e0601b 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -276,6 +276,8 @@ project [ run sequence/swap.cpp ] [ run support/config.cpp ] + [ compile support/config_pfr_0.cpp ] + [ compile support/config_pfr_1.cpp ] [ compile support/is_sequence.cpp ] [ compile support/is_view.cpp ] [ compile support/pair_deque.cpp ] diff --git a/test/support/config_pfr_0.cpp b/test/support/config_pfr_0.cpp new file mode 100644 index 000000000..dac1ee957 --- /dev/null +++ b/test/support/config_pfr_0.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2021-2023 Denis Mikhailov + 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) +==============================================================================*/ + +#define BOOST_PFR_ENABLED 1 +#define BOOST_PFR_ENABLE_IMPLICIT_REFLECTION 0 + +#include +#include + +BOOST_STATIC_ASSERT(BOOST_FUSION_PFR_ENABLED == BOOST_PFR_ENABLED); +BOOST_STATIC_ASSERT(BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION == BOOST_PFR_ENABLE_IMPLICIT_REFLECTION); + +int main() { } + diff --git a/test/support/config_pfr_1.cpp b/test/support/config_pfr_1.cpp new file mode 100644 index 000000000..8b9aa60df --- /dev/null +++ b/test/support/config_pfr_1.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2021-2023 Denis Mikhailov + 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) +==============================================================================*/ + +#define BOOST_FUSION_PFR_ENABLED 0 +#define BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION 1 +#define BOOST_PFR_ENABLED 1 +#define BOOST_PFR_ENABLE_IMPLICIT_REFLECTION 0 + +#include +#include + +BOOST_STATIC_ASSERT(BOOST_FUSION_PFR_ENABLED != BOOST_PFR_ENABLED); +BOOST_STATIC_ASSERT(BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION != BOOST_PFR_ENABLE_IMPLICIT_REFLECTION); + +int main() { } + From e016b0926e429f33c5489ee6ca7a49d40a7e95d4 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Mon, 23 Jan 2023 00:30:40 +0600 Subject: [PATCH 12/24] [pfr_implicit_explicit] First successful step for regression tests --- .../adapted/boost_pfr/tag_of_fallback.hpp | 52 ++- test/Jamfile | 303 +++++++++--------- test/sequence/adapt_adt.cpp | 2 + test/sequence/with_or_without_fallback.hpp | 17 + util/test.jam | 47 +++ 5 files changed, 265 insertions(+), 156 deletions(-) create mode 100644 test/sequence/with_or_without_fallback.hpp create mode 100644 util/test.jam diff --git a/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp index 762d7da43..d08f86cd3 100644 --- a/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp +++ b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -24,15 +25,52 @@ namespace boost { namespace fusion namespace detail { + // Helper function that returns true if `name` starts with `substr` + template + constexpr bool starts_with(const char* name, const char (&substr)[N]) noexcept { + static_assert(N > 0, "non a zero-terminated string passed"); + for (std::size_t i = 0; i + constexpr bool in_namespace(const char (&ns)[N]) noexcept { + const char* name = boost::typeindex::ctti_type_index::type_id().raw_name(); + + // Some compilers add `class ` or `struct ` before the namespace, so we need to skip those words first + if (detail::starts_with(name, "class ")) { + name += sizeof("class ") - 1; + } else if (detail::starts_with(name, "struct ")) { + name += sizeof("struct ") - 1; + } + + return detail::starts_with(name, ns) && detail::starts_with(name + N - 1, "::"); + } + + template + constexpr bool is_implicitly_reflectable_via_pfr() noexcept { + // TODO: check that T is complete + const auto possible_pfr = boost::pfr::is_implicitly_reflectable< + T, boost::pfr::boost_fusion_tag>::value; + const auto value = !std::is_array::value + && !detail::in_namespace("boost::fusion") + && !detail::in_namespace("boost::mpl") + && !detail::in_namespace("mpl_") + && possible_pfr; + return value; + } + template - struct tag_of_fallback::value>> + struct tag_of_fallback()>> { - static constexpr auto possible_pfr = boost::pfr::is_implicitly_reflectable< - T, boost::pfr::boost_fusion_tag>::value; - using type = std::conditional_t<(!std::is_array::value && possible_pfr) - , boost_pfr_tag - , non_fusion_tag - >; + using type = boost_pfr_tag; }; } }} diff --git a/test/Jamfile b/test/Jamfile index ba7e0601b..59a75b652 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -12,6 +12,11 @@ import testing ; import os ; import ../../config/checks/config : requires ; +# import rules from the boost fusion test +import ../util/test : + test-bfl-run_with_and_without_fallback +; + if [ os.environ CI ] { CI_DEFINES = CI_SKIP_KNOWN_FAILURE=1 ; @@ -74,12 +79,12 @@ project [ compile include/_boost_pfr_explicit.cpp : [ requires cxx14_constexpr ] ] - [ run sequence/as_deque.cpp ] - [ run sequence/as_list.cpp ] - [ run sequence/as_map.cpp ] - [ run sequence/as_map_assoc.cpp ] - [ run sequence/as_set.cpp ] - [ run sequence/as_vector.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_deque.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_list.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_map.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_map_assoc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_set.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/as_vector.cpp ] [ run sequence/boost_pfr.cpp : : : BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_empty.cpp : : @@ -92,172 +97,172 @@ project : [ requires cxx14_constexpr ] ] [ run sequence/boost_pfr_explicit.cpp : : : [ requires cxx14_constexpr ] ] - [ run sequence/boost_tuple.cpp ] - [ run sequence/boost_tuple_iterator.cpp ] - [ run sequence/cons.cpp ] - [ run sequence/convert_boost_tuple.cpp ] - [ run sequence/convert_deque.cpp ] - [ run sequence/convert_list.cpp ] - [ run sequence/convert_std_pair.cpp ] - [ run sequence/convert_std_tuple.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/boost_tuple.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/boost_tuple_iterator.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/cons.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_boost_tuple.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_deque.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_list.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_std_pair.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_std_tuple.cpp : : : [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ] - [ run sequence/convert_vector.cpp ] - [ run sequence/filter_view.cpp ] - [ run sequence/hash.cpp ] - [ run sequence/io.cpp ] - [ run sequence/iterator_range.cpp ] - [ run sequence/joint_view.cpp ] - [ run sequence/list_comparison.cpp ] - [ run sequence/list_construction.cpp ] - [ run sequence/list_copy.cpp ] - [ run sequence/list_iterator.cpp ] - [ run sequence/list_hash.cpp ] - [ run sequence/list_make.cpp ] - [ run sequence/list_misc.cpp ] - [ run sequence/list_mutate.cpp ] - [ run sequence/list_nest.cpp ] - [ run sequence/list_tie.cpp ] - [ run sequence/list_value_at.cpp ] - [ run sequence/deque_comparison.cpp ] - [ run sequence/deque_construction.cpp ] - [ run sequence/deque_copy.cpp ] - [ run sequence/deque_iterator.cpp ] - [ run sequence/deque_hash.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/convert_vector.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/filter_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/hash.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/io.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/iterator_range.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/joint_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_comparison.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_construction.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_copy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_iterator.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_hash.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_make.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_misc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_mutate.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_nest.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_tie.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/list_value_at.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_comparison.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_construction.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_copy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_iterator.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_hash.cpp ] [ compile sequence/deque_is_constructible.cpp ] - [ run sequence/deque_make.cpp ] - [ run sequence/deque_misc.cpp ] - [ run sequence/deque_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/deque_make.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_misc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/deque_mutate.cpp ] - [ run sequence/deque_nest.cpp ] - [ run sequence/deque_tie.cpp ] - [ run sequence/deque_value_at.cpp ] - [ run sequence/front_extended_deque.cpp ] - [ run sequence/back_extended_deque.cpp ] - [ run sequence/make_list.cpp ] - [ run sequence/make_vector.cpp ] - [ run sequence/map.cpp ] - [ run sequence/map_comparison.cpp ] - [ run sequence/map_construction.cpp ] - [ run sequence/map_copy.cpp ] - [ run sequence/map_misc.cpp ] - [ run sequence/map_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/deque_mutate.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_nest.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_tie.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deque_value_at.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/front_extended_deque.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/back_extended_deque.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/make_list.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/make_vector.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_comparison.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_construction.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_copy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_misc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/map_mutate.cpp ] - [ run sequence/map_tie.cpp ] - [ run sequence/nil.cpp ] - [ run sequence/nview.cpp ] - [ run sequence/reverse_view.cpp ] - [ run sequence/segmented_iterator_range.cpp ] - [ run sequence/set.cpp ] - [ run sequence/single_view.cpp ] - [ run sequence/std_pair.cpp ] - [ run sequence/boost_array.cpp ] - [ run sequence/array.cpp ] - [ run sequence/std_array.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/map_mutate.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/map_tie.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/nil.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/nview.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/reverse_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/segmented_iterator_range.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/set.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/single_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/std_pair.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/boost_array.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/array.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/std_array.cpp : : : [ requires cxx11_hdr_array ] ] - [ run sequence/tuple_comparison.cpp ] - [ run sequence/tuple_construction.cpp ] - [ run sequence/tuple_conversion.cpp ] - [ run sequence/tuple_copy.cpp ] - [ run sequence/tuple_element.cpp ] - [ run sequence/tuple_make.cpp ] - [ run sequence/tuple_misc.cpp ] - [ run sequence/tuple_mutate.cpp ] - [ run sequence/tuple_nest.cpp ] - [ run sequence/tuple_hash.cpp ] - [ run sequence/tuple_tie.cpp ] - [ run sequence/tuple_traits.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/tuple_comparison.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_construction.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_conversion.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_copy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_element.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_make.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_misc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_mutate.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_nest.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_hash.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_tie.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/tuple_traits.cpp : : : : tuple_traits__maybe_variadic ] - [ run sequence/tuple_traits.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/tuple_traits.cpp : : : BOOST_FUSION_DISABLE_VARIADIC_VECTOR : tuple_traits__no_variadic ] - [ run sequence/transform_view.cpp ] - [ run sequence/identity_view.cpp ] - [ run sequence/vector_comparison.cpp ] - [ run sequence/vector_construction.cpp ] - [ run sequence/vector_conversion.cpp ] - [ run sequence/vector_copy.cpp ] - [ run sequence/vector_iterator.cpp ] - [ run sequence/vector_make.cpp ] - [ run sequence/vector_misc.cpp ] - [ run sequence/vector_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/transform_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/identity_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_comparison.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_construction.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_conversion.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_copy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_iterator.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_make.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_misc.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/vector_mutate.cpp ] - [ run sequence/vector_n.cpp ] - [ run sequence/vector_nest.cpp ] - [ run sequence/vector_hash.cpp ] - [ run sequence/vector_tie.cpp ] - [ run sequence/vector_traits.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/vector_mutate.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_n.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_nest.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_hash.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_tie.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/vector_traits.cpp : : : : vector_traits__maybe_variadic ] - [ run sequence/vector_traits.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/vector_traits.cpp : : : BOOST_FUSION_DISABLE_VARIADIC_VECTOR : vector_traits__no_variadic ] - [ run sequence/vector_value_at.cpp ] - [ run sequence/zip_view.cpp ] - [ run sequence/zip_view2.cpp ] - [ run sequence/zip_view_ignore.cpp ] - [ run sequence/repetitive_view.cpp ] - [ run sequence/deduce_sequence.cpp ] - [ run sequence/adapt_adt_named.cpp ] - [ run sequence/adapt_adt_named_empty.cpp ] - [ run sequence/adapt_adt.cpp ] - [ run sequence/adapt_adt_empty.cpp ] - [ run sequence/adapt_assoc_adt_named.cpp ] - [ run sequence/adapt_assoc_adt_named_empty.cpp ] - [ run sequence/adapt_assoc_adt.cpp ] - [ run sequence/adapt_assoc_adt_empty.cpp ] - [ run sequence/adapt_assoc_struct_named.cpp ] - [ run sequence/adapt_assoc_struct_named_empty.cpp ] - [ run sequence/adapt_assoc_struct.cpp ] - [ run sequence/adapt_assoc_struct_empty.cpp ] - [ run sequence/adapt_assoc_tpl_adt.cpp ] - [ run sequence/adapt_assoc_tpl_adt_empty.cpp ] - [ run sequence/adapt_assoc_tpl_struct.cpp ] - [ run sequence/adapt_assoc_tpl_struct_empty.cpp ] - [ run sequence/adapt_struct_named.cpp ] - [ run sequence/adapt_struct_named_empty.cpp ] - [ run sequence/adapt_struct.cpp ] - [ run sequence/adapt_struct_empty.cpp ] - [ run sequence/adapt_tpl_adt.cpp ] - [ run sequence/adapt_tpl_adt_empty.cpp ] - [ run sequence/adapt_tpl_struct.cpp ] - [ run sequence/adapt_tpl_struct_empty.cpp ] - [ run sequence/adt_attribute_proxy.cpp ] - [ run sequence/define_struct.cpp ] - [ run sequence/define_struct_empty.cpp ] - [ run sequence/define_struct_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/vector_value_at.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/zip_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/zip_view2.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/zip_view_ignore.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/repetitive_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/deduce_sequence.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_adt_named.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_adt_named_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_adt.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_adt_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_adt_named.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_adt_named_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_adt.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_adt_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_struct_named.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_struct_named_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_tpl_adt.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_tpl_adt_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_tpl_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_assoc_tpl_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_struct_named.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_struct_named_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_tpl_adt.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_tpl_adt_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_tpl_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adapt_tpl_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/adt_attribute_proxy.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_struct_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/define_struct_inline.cpp ] - [ run sequence/define_struct_inline_empty.cpp ] - [ run sequence/define_struct_inline_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/define_struct_inline.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_struct_inline_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_struct_inline_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/define_assoc_struct.cpp ] - [ run sequence/define_assoc_struct_empty.cpp ] - [ run sequence/define_assoc_struct_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_struct_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/define_tpl_struct.cpp ] - [ run sequence/define_tpl_struct_empty.cpp ] - [ run sequence/define_tpl_struct_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/define_tpl_struct_inline.cpp ] - [ run sequence/define_tpl_struct_inline_empty.cpp ] - [ run sequence/define_tpl_struct_inline_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct_inline.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct_inline_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_tpl_struct_inline_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/define_assoc_tpl_struct.cpp ] - [ run sequence/define_assoc_tpl_struct_empty.cpp ] - [ run sequence/define_assoc_tpl_struct_move.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_tpl_struct.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_tpl_struct_empty.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/define_assoc_tpl_struct_move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run sequence/std_tuple.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/std_tuple.cpp : : : [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ] - [ run sequence/std_tuple_iterator.cpp : : + [ test-bfl-run_with_and_without_fallback sequence/std_tuple_iterator.cpp : : : [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ] - [ run sequence/ref_vector.cpp ] - [ run sequence/flatten_view.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/ref_vector.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/flatten_view.cpp ] [ compile sequence/github-159.cpp ] - [ run sequence/github-176.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/github-176.cpp ] [ compile sequence/size.cpp ] diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 00a149b72..59a58dfb2 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -32,6 +32,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { class point diff --git a/test/sequence/with_or_without_fallback.hpp b/test/sequence/with_or_without_fallback.hpp new file mode 100644 index 000000000..23c51d017 --- /dev/null +++ b/test/sequence/with_or_without_fallback.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2023 Denis Mikhailov + 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) +==============================================================================*/ + +// This header provides ability for regression test of Boost PFR adapter. + +#if BOOST_FUSION_USE_TAG_OF_FALLBACK +// this branch may be without fallback in old compilers +#include +#elif BOOST_FUSION_DO_NOT_USE_TAG_OF_FALLBACK +// just nothing +#else +#error Do you need to use tag_of fallback or you do not? +#endif + diff --git a/util/test.jam b/util/test.jam new file mode 100644 index 000000000..5d971693b --- /dev/null +++ b/util/test.jam @@ -0,0 +1,47 @@ +# Boost Fusion Library utility test Jamfile + +# (C) Copyright Denis Mikhailov 2023. +# Use, modification, and distribution are subject to 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) +# + +# the file contains Jam rules which are used in both the normal +# boost test, as well as the fallback test and so other +# tests. + +# import rules for testing conditional on config file variables +import ../../config/checks/config : requires ; + +rule test-bfl-run_with_and_without_fallback ( sources + : args * : input-files * : requirements * : target-name ? + : default-build * ) { + local tests ; + if ! $(target-name) + { + target-name = $(sources[1]:B) ; + } + tests += [ + run + $(sources) + : $(args) + : $(input-files) + : BOOST_FUSION_DO_NOT_USE_TAG_OF_FALLBACK=1 + $(requirements) + : $(target-name)__normal + : $(default-build) + ] ; + tests += [ + run + $(sources) + : $(args) + : $(input-files) + : BOOST_FUSION_USE_TAG_OF_FALLBACK=1 + $(requirements) + : $(target-name)__fallback + : $(default-build) + ] ; + return $(tests) ; +} + +# TODO: test-bfl-compile_with_and_without_fallback +# TODO: test-bfl-compile_strictly_without_fallback \ No newline at end of file From 730775403769c5676dd571e3680d4bc710b8a7a1 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Mon, 23 Jan 2023 00:37:36 +0600 Subject: [PATCH 13/24] [pfr_implicit_explicit] Regression tests for 'sequence' group --- test/Jamfile | 7 +++--- test/sequence/adapt_adt_empty.cpp | 2 ++ test/sequence/adapt_adt_named.cpp | 2 ++ test/sequence/adapt_adt_named_empty.cpp | 2 ++ test/sequence/adapt_assoc_adt.cpp | 2 ++ test/sequence/adapt_assoc_adt_empty.cpp | 2 ++ test/sequence/adapt_assoc_adt_named.cpp | 2 ++ test/sequence/adapt_assoc_adt_named_empty.cpp | 2 ++ test/sequence/adapt_assoc_struct.cpp | 2 ++ test/sequence/adapt_assoc_struct_empty.cpp | 2 ++ test/sequence/adapt_assoc_struct_named.cpp | 2 ++ .../adapt_assoc_struct_named_empty.cpp | 2 ++ test/sequence/adapt_assoc_tpl_adt.cpp | 2 ++ test/sequence/adapt_assoc_tpl_adt_empty.cpp | 2 ++ test/sequence/adapt_assoc_tpl_struct.cpp | 2 ++ .../sequence/adapt_assoc_tpl_struct_empty.cpp | 2 ++ test/sequence/adapt_struct.cpp | 2 ++ test/sequence/adapt_struct_empty.cpp | 2 ++ test/sequence/adapt_struct_named.cpp | 2 ++ test/sequence/adapt_struct_named_empty.cpp | 2 ++ test/sequence/adapt_tpl_adt.cpp | 2 ++ test/sequence/adapt_tpl_adt_empty.cpp | 2 ++ test/sequence/adapt_tpl_struct.cpp | 2 ++ test/sequence/adapt_tpl_struct_empty.cpp | 2 ++ test/sequence/adt_attribute_proxy.cpp | 2 ++ test/sequence/array.cpp | 2 ++ test/sequence/as_deque.cpp | 1 + test/sequence/as_list.cpp | 2 ++ test/sequence/as_map.cpp | 5 +++- test/sequence/as_map_assoc.cpp | 2 ++ test/sequence/as_set.cpp | 2 ++ test/sequence/as_vector.cpp | 2 ++ test/sequence/back_extended_deque.cpp | 2 ++ test/sequence/boost_array.cpp | 2 ++ test/sequence/boost_tuple.cpp | 2 ++ test/sequence/boost_tuple_iterator.cpp | 2 ++ test/sequence/comparison.hpp | 5 ++++ test/sequence/cons.cpp | 2 ++ test/sequence/convert_boost_tuple.cpp | 2 ++ test/sequence/convert_deque.cpp | 2 ++ test/sequence/convert_list.cpp | 2 ++ test/sequence/convert_std_pair.cpp | 2 ++ test/sequence/convert_std_tuple.cpp | 3 +++ test/sequence/convert_vector.cpp | 2 ++ test/sequence/deduce_sequence.cpp | 2 ++ test/sequence/define_assoc_struct.cpp | 2 ++ test/sequence/define_assoc_struct_empty.cpp | 2 ++ test/sequence/define_assoc_struct_move.cpp | 2 ++ test/sequence/define_assoc_tpl_struct.cpp | 2 ++ .../define_assoc_tpl_struct_empty.cpp | 2 ++ .../sequence/define_assoc_tpl_struct_move.cpp | 2 ++ test/sequence/define_struct.cpp | 2 ++ test/sequence/define_struct_empty.cpp | 2 ++ test/sequence/define_struct_inline.cpp | 2 ++ test/sequence/define_struct_inline_empty.cpp | 2 ++ test/sequence/define_struct_inline_move.cpp | 2 ++ test/sequence/define_struct_move.cpp | 2 ++ test/sequence/define_tpl_struct.cpp | 2 ++ test/sequence/define_tpl_struct_empty.cpp | 2 ++ test/sequence/define_tpl_struct_inline.cpp | 2 ++ .../define_tpl_struct_inline_empty.cpp | 2 ++ .../define_tpl_struct_inline_move.cpp | 2 ++ test/sequence/define_tpl_struct_move.cpp | 2 ++ test/sequence/deque_comparison.cpp | 2 ++ test/sequence/deque_construction.cpp | 2 ++ test/sequence/deque_copy.cpp | 2 ++ test/sequence/deque_hash.cpp | 2 ++ test/sequence/deque_is_constructible.cpp | 3 +++ test/sequence/deque_iterator.cpp | 2 ++ test/sequence/deque_make.cpp | 2 ++ test/sequence/deque_misc.cpp | 2 ++ test/sequence/deque_move.cpp | 2 ++ test/sequence/deque_mutate.cpp | 2 ++ test/sequence/deque_nest.cpp | 2 ++ test/sequence/deque_tie.cpp | 2 ++ test/sequence/deque_value_at.cpp | 2 ++ test/sequence/filter_view.cpp | 2 ++ test/sequence/flatten_view.cpp | 1 + test/sequence/front_extended_deque.cpp | 2 ++ test/sequence/github-159.cpp | 2 ++ test/sequence/github-176.cpp | 2 ++ test/sequence/hash.cpp | 2 ++ test/sequence/identity_view.cpp | 2 ++ test/sequence/io.cpp | 2 ++ test/sequence/iterator_range.cpp | 2 ++ test/sequence/joint_view.cpp | 2 ++ test/sequence/list_comparison.cpp | 2 ++ test/sequence/list_construction.cpp | 2 ++ test/sequence/list_copy.cpp | 2 ++ test/sequence/list_hash.cpp | 2 ++ test/sequence/list_iterator.cpp | 2 ++ test/sequence/list_make.cpp | 2 ++ test/sequence/list_misc.cpp | 2 ++ test/sequence/list_mutate.cpp | 2 ++ test/sequence/list_nest.cpp | 2 ++ test/sequence/list_tie.cpp | 2 ++ test/sequence/list_value_at.cpp | 2 ++ test/sequence/make_list.cpp | 2 ++ test/sequence/make_vector.cpp | 2 ++ test/sequence/map.cpp | 1 + test/sequence/map_comparison.cpp | 2 ++ test/sequence/map_construction.cpp | 2 ++ test/sequence/map_copy.cpp | 2 ++ test/sequence/map_misc.cpp | 2 ++ test/sequence/map_move.cpp | 2 ++ test/sequence/map_mutate.cpp | 2 ++ test/sequence/map_tie.cpp | 2 ++ test/sequence/nil.cpp | 1 + test/sequence/nview.cpp | 2 ++ test/sequence/ref_vector.cpp | 2 ++ test/sequence/repetitive_view.cpp | 2 ++ test/sequence/reverse_view.cpp | 1 + test/sequence/segmented_iterator_range.cpp | 4 +++ test/sequence/set.cpp | 2 ++ test/sequence/single_view.cpp | 2 ++ test/sequence/std_array.cpp | 2 ++ test/sequence/std_pair.cpp | 2 ++ test/sequence/std_tuple.cpp | 2 ++ test/sequence/std_tuple_iterator.cpp | 2 ++ test/sequence/transform_view.cpp | 2 ++ test/sequence/tuple_comparison.cpp | 2 ++ test/sequence/tuple_construction.cpp | 2 ++ test/sequence/tuple_conversion.cpp | 2 ++ test/sequence/tuple_copy.cpp | 2 ++ test/sequence/tuple_element.cpp | 2 ++ test/sequence/tuple_hash.cpp | 2 ++ test/sequence/tuple_make.cpp | 2 ++ test/sequence/tuple_misc.cpp | 2 ++ test/sequence/tuple_mutate.cpp | 2 ++ test/sequence/tuple_nest.cpp | 2 ++ test/sequence/tuple_tie.cpp | 2 ++ test/sequence/tuple_traits.cpp | 2 ++ test/sequence/vector_comparison.cpp | 2 ++ test/sequence/vector_construction.cpp | 2 ++ test/sequence/vector_conversion.cpp | 2 ++ test/sequence/vector_copy.cpp | 2 ++ test/sequence/vector_hash.cpp | 2 ++ test/sequence/vector_iterator.cpp | 2 ++ test/sequence/vector_make.cpp | 2 ++ test/sequence/vector_misc.cpp | 2 ++ test/sequence/vector_move.cpp | 2 ++ test/sequence/vector_mutate.cpp | 2 ++ test/sequence/vector_n.cpp | 1 + test/sequence/vector_nest.cpp | 2 ++ test/sequence/vector_tie.cpp | 2 ++ test/sequence/vector_traits.cpp | 2 ++ test/sequence/vector_value_at.cpp | 2 ++ test/sequence/zip_view.cpp | 2 ++ test/sequence/zip_view2.cpp | 2 ++ test/sequence/zip_view_ignore.cpp | 2 ++ util/test.jam | 25 ++++++++++++++++++- 151 files changed, 329 insertions(+), 5 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 59a75b652..b184af864 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -15,6 +15,7 @@ import ../../config/checks/config : requires ; # import rules from the boost fusion test import ../util/test : test-bfl-run_with_and_without_fallback + test-bfl-compile_with_and_without_fallback ; if [ os.environ CI ] @@ -128,7 +129,7 @@ project [ test-bfl-run_with_and_without_fallback sequence/deque_copy.cpp ] [ test-bfl-run_with_and_without_fallback sequence/deque_iterator.cpp ] [ test-bfl-run_with_and_without_fallback sequence/deque_hash.cpp ] - [ compile sequence/deque_is_constructible.cpp ] + [ test-bfl-compile_with_and_without_fallback sequence/deque_is_constructible.cpp ] [ test-bfl-run_with_and_without_fallback sequence/deque_make.cpp ] [ test-bfl-run_with_and_without_fallback sequence/deque_misc.cpp ] [ test-bfl-run_with_and_without_fallback sequence/deque_move.cpp : : @@ -261,10 +262,10 @@ project : [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ] [ test-bfl-run_with_and_without_fallback sequence/ref_vector.cpp ] [ test-bfl-run_with_and_without_fallback sequence/flatten_view.cpp ] - [ compile sequence/github-159.cpp ] + [ test-bfl-compile_with_and_without_fallback sequence/github-159.cpp ] [ test-bfl-run_with_and_without_fallback sequence/github-176.cpp ] - [ compile sequence/size.cpp ] + [ test-bfl-compile_with_and_without_fallback sequence/size.cpp ] [ run functional/fused.cpp ] [ run functional/fused_function_object.cpp ] diff --git a/test/sequence/adapt_adt_empty.cpp b/test/sequence/adapt_adt_empty.cpp index 03e786b7a..e78884f72 100644 --- a/test/sequence/adapt_adt_empty.cpp +++ b/test/sequence/adapt_adt_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_adt{}; BOOST_FUSION_ADAPT_ADT(empty_adt,) diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 19d2d8b11..256b22882 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -31,6 +31,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { class point diff --git a/test/sequence/adapt_adt_named_empty.cpp b/test/sequence/adapt_adt_named_empty.cpp index c7fa20331..064e69dd7 100644 --- a/test/sequence/adapt_adt_named_empty.cpp +++ b/test/sequence/adapt_adt_named_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_adt{}; BOOST_FUSION_ADAPT_ADT_NAMED(::empty_adt,empty_adt,) diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index a0dc22326..7d3a898fb 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_adt_empty.cpp b/test/sequence/adapt_assoc_adt_empty.cpp index 26cd98573..951477afe 100644 --- a/test/sequence/adapt_assoc_adt_empty.cpp +++ b/test/sequence/adapt_assoc_adt_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_adt{}; BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,) diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index ecdd9028f..10eac4379 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_adt_named_empty.cpp b/test/sequence/adapt_assoc_adt_named_empty.cpp index e2e268001..d181f5d1c 100644 --- a/test/sequence/adapt_assoc_adt_named_empty.cpp +++ b/test/sequence/adapt_assoc_adt_named_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_adt{}; BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(::empty_adt,empty_adt,) diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 6266e95f1..e60aab2a9 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -38,6 +38,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_struct_empty.cpp b/test/sequence/adapt_assoc_struct_empty.cpp index c7cadf947..6886f1f97 100644 --- a/test/sequence/adapt_assoc_struct_empty.cpp +++ b/test/sequence/adapt_assoc_struct_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_struct{}; BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,) diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index 966067871..df851c80e 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -18,6 +18,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_struct_named_empty.cpp b/test/sequence/adapt_assoc_struct_named_empty.cpp index a1783fd3b..fd884f281 100644 --- a/test/sequence/adapt_assoc_struct_named_empty.cpp +++ b/test/sequence/adapt_assoc_struct_named_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_struct{}; BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(::empty_struct,empty_struct,) diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index f416f46a8..8f8cb958b 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_tpl_adt_empty.cpp b/test/sequence/adapt_assoc_tpl_adt_empty.cpp index f38ba7ac7..5a52d8ecd 100644 --- a/test/sequence/adapt_assoc_tpl_adt_empty.cpp +++ b/test/sequence/adapt_assoc_tpl_adt_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template class empty_adt{}; BOOST_FUSION_ADAPT_ASSOC_TPL_ADT((T), (empty_adt)(T),) diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index 49f42c5d2..1c27630d1 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -33,6 +33,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/adapt_assoc_tpl_struct_empty.cpp b/test/sequence/adapt_assoc_tpl_struct_empty.cpp index 42795c419..230e0d2f4 100644 --- a/test/sequence/adapt_assoc_tpl_struct_empty.cpp +++ b/test/sequence/adapt_assoc_tpl_struct_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template class empty_struct{}; BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((T), (empty_struct)(T),) diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 3518ff418..5382b9380 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -32,6 +32,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace namespaced_type { typedef int integer; } diff --git a/test/sequence/adapt_struct_empty.cpp b/test/sequence/adapt_struct_empty.cpp index 202131d44..016089221 100644 --- a/test/sequence/adapt_struct_empty.cpp +++ b/test/sequence/adapt_struct_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_struct{}; BOOST_FUSION_ADAPT_STRUCT(empty_struct,) diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index ec5cf7bac..052878b7f 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -31,6 +31,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct point diff --git a/test/sequence/adapt_struct_named_empty.cpp b/test/sequence/adapt_struct_named_empty.cpp index 7272f6f61..e872cbf6e 100644 --- a/test/sequence/adapt_struct_named_empty.cpp +++ b/test/sequence/adapt_struct_named_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + class empty_struct{}; BOOST_FUSION_ADAPT_STRUCT_NAMED(::empty_struct,empty_struct,) diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index d917134a7..579bbe803 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -32,6 +32,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { template diff --git a/test/sequence/adapt_tpl_adt_empty.cpp b/test/sequence/adapt_tpl_adt_empty.cpp index 82bf21214..9bc6b3d68 100644 --- a/test/sequence/adapt_tpl_adt_empty.cpp +++ b/test/sequence/adapt_tpl_adt_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template class empty_adt{}; BOOST_FUSION_ADAPT_TPL_ADT((T), (empty_adt)(T),) diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 1776cd62a..af3c1893c 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -28,6 +28,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { template diff --git a/test/sequence/adapt_tpl_struct_empty.cpp b/test/sequence/adapt_tpl_struct_empty.cpp index 5cb1d442e..549b748d2 100644 --- a/test/sequence/adapt_tpl_struct_empty.cpp +++ b/test/sequence/adapt_tpl_struct_empty.cpp @@ -27,6 +27,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template class empty_struct{}; BOOST_FUSION_ADAPT_TPL_STRUCT((T), (empty_struct)(T),) diff --git a/test/sequence/adt_attribute_proxy.cpp b/test/sequence/adt_attribute_proxy.cpp index eae4eb9a8..0afb29be1 100644 --- a/test/sequence/adt_attribute_proxy.cpp +++ b/test/sequence/adt_attribute_proxy.cpp @@ -13,6 +13,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace fusion=boost::fusion; template diff --git a/test/sequence/array.cpp b/test/sequence/array.cpp index ca4a40ac9..82f50d454 100644 --- a/test/sequence/array.cpp +++ b/test/sequence/array.cpp @@ -15,6 +15,8 @@ #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/as_deque.cpp b/test/sequence/as_deque.cpp index c56c598dd..49d305ade 100644 --- a/test/sequence/as_deque.cpp +++ b/test/sequence/as_deque.cpp @@ -16,6 +16,7 @@ #include +#include "with_or_without_fallback.hpp" int main() { using namespace boost::fusion; diff --git a/test/sequence/as_list.cpp b/test/sequence/as_list.cpp index 8ee8bf128..24b198958 100644 --- a/test/sequence/as_list.cpp +++ b/test/sequence/as_list.cpp @@ -15,6 +15,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/as_map.cpp b/test/sequence/as_map.cpp index d2a89cc6c..3bec5aeb4 100644 --- a/test/sequence/as_map.cpp +++ b/test/sequence/as_map.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { @@ -29,7 +31,8 @@ main() { vector0<> empty; - std::cout << as_map(make_list(make_pair('X'), make_pair("Men"))) << std::endl; + // Conversion for std::string need to prevent 'error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream’} and ‘const char [4]’)' + std::cout << as_map(make_list(make_pair('X'), make_pair(std::string("Men")))) << std::endl; std::cout << as_map(push_back(empty, make_pair(999))) << std::endl; } diff --git a/test/sequence/as_map_assoc.cpp b/test/sequence/as_map_assoc.cpp index bc9a6951c..83a52756f 100644 --- a/test/sequence/as_map_assoc.cpp +++ b/test/sequence/as_map_assoc.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/as_set.cpp b/test/sequence/as_set.cpp index 97dd89e87..518b58934 100644 --- a/test/sequence/as_set.cpp +++ b/test/sequence/as_set.cpp @@ -18,6 +18,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/as_vector.cpp b/test/sequence/as_vector.cpp index af1aaffb8..30587f991 100644 --- a/test/sequence/as_vector.cpp +++ b/test/sequence/as_vector.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/back_extended_deque.cpp b/test/sequence/back_extended_deque.cpp index 368ec0c26..129ead171 100644 --- a/test/sequence/back_extended_deque.cpp +++ b/test/sequence/back_extended_deque.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/boost_array.cpp b/test/sequence/boost_array.cpp index f3f714700..3aa121e26 100644 --- a/test/sequence/boost_array.cpp +++ b/test/sequence/boost_array.cpp @@ -19,6 +19,8 @@ #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/boost_tuple.cpp b/test/sequence/boost_tuple.cpp index abe7d3c83..6a1912f49 100644 --- a/test/sequence/boost_tuple.cpp +++ b/test/sequence/boost_tuple.cpp @@ -33,6 +33,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/boost_tuple_iterator.cpp b/test/sequence/boost_tuple_iterator.cpp index 3ab096b9b..b0c66f4a9 100644 --- a/test/sequence/boost_tuple_iterator.cpp +++ b/test/sequence/boost_tuple_iterator.cpp @@ -7,6 +7,8 @@ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::tuple #define FUSION_TRAVERSAL_TAG forward_traversal_tag #define FUSION_NO_PRIOR diff --git a/test/sequence/comparison.hpp b/test/sequence/comparison.hpp index 2c954d0a5..cbcc10075 100644 --- a/test/sequence/comparison.hpp +++ b/test/sequence/comparison.hpp @@ -7,8 +7,13 @@ ==============================================================================*/ #include #include +#include + +// TODO: force.hpp should be documented and tested that it won't adapt pfr implicitly or explicitly struct not_a_fusion_container {}; +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(not_a_fusion_container) + template inline bool operator==(not_a_fusion_container, T const&) { return true; } template diff --git a/test/sequence/cons.cpp b/test/sequence/cons.cpp index 88a04101c..b6bf54317 100644 --- a/test/sequence/cons.cpp +++ b/test/sequence/cons.cpp @@ -22,6 +22,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/convert_boost_tuple.cpp b/test/sequence/convert_boost_tuple.cpp index 588ee4d7f..624daad6f 100644 --- a/test/sequence/convert_boost_tuple.cpp +++ b/test/sequence/convert_boost_tuple.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::tuples::tuple #include "convert.hpp" diff --git a/test/sequence/convert_deque.cpp b/test/sequence/convert_deque.cpp index 5be34d3f6..5ed0b46f4 100644 --- a/test/sequence/convert_deque.cpp +++ b/test/sequence/convert_deque.cpp @@ -8,6 +8,8 @@ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::deque #include "convert.hpp" diff --git a/test/sequence/convert_list.cpp b/test/sequence/convert_list.cpp index 57ad05078..ea94fe71d 100644 --- a/test/sequence/convert_list.cpp +++ b/test/sequence/convert_list.cpp @@ -8,6 +8,8 @@ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::list #include "convert.hpp" diff --git a/test/sequence/convert_std_pair.cpp b/test/sequence/convert_std_pair.cpp index aa350025a..350ca95b6 100644 --- a/test/sequence/convert_std_pair.cpp +++ b/test/sequence/convert_std_pair.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE std::pair #include "convert.hpp" diff --git a/test/sequence/convert_std_tuple.cpp b/test/sequence/convert_std_tuple.cpp index 643f01cfe..e04dc6355 100644 --- a/test/sequence/convert_std_tuple.cpp +++ b/test/sequence/convert_std_tuple.cpp @@ -16,5 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE std::tuple #include "convert.hpp" + diff --git a/test/sequence/convert_vector.cpp b/test/sequence/convert_vector.cpp index b39014df2..414881f92 100644 --- a/test/sequence/convert_vector.cpp +++ b/test/sequence/convert_vector.cpp @@ -8,6 +8,8 @@ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::vector #include "convert.hpp" diff --git a/test/sequence/deduce_sequence.cpp b/test/sequence/deduce_sequence.cpp index 3bccc20a1..7b031cfea 100644 --- a/test/sequence/deduce_sequence.cpp +++ b/test/sequence/deduce_sequence.cpp @@ -18,6 +18,8 @@ #include #endif +#include "with_or_without_fallback.hpp" + using boost::is_same; using boost::reference_wrapper; using boost::fusion::traits::deduce; diff --git a/test/sequence/define_assoc_struct.cpp b/test/sequence/define_assoc_struct.cpp index 231621f89..6ba494b01 100644 --- a/test/sequence/define_assoc_struct.cpp +++ b/test/sequence/define_assoc_struct.cpp @@ -15,6 +15,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/define_assoc_struct_empty.cpp b/test/sequence/define_assoc_struct_empty.cpp index 91dd2f350..651151c54 100644 --- a/test/sequence/define_assoc_struct_empty.cpp +++ b/test/sequence/define_assoc_struct_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_ASSOC_STRUCT(BOOST_PP_EMPTY(), empty_struct, ) int diff --git a/test/sequence/define_assoc_struct_move.cpp b/test/sequence/define_assoc_struct_move.cpp index 07def389f..c1a1f37c8 100644 --- a/test/sequence/define_assoc_struct_move.cpp +++ b/test/sequence/define_assoc_struct_move.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct key_type; struct wrapper { diff --git a/test/sequence/define_assoc_tpl_struct.cpp b/test/sequence/define_assoc_tpl_struct.cpp index bdbcfe470..361c81a8c 100644 --- a/test/sequence/define_assoc_tpl_struct.cpp +++ b/test/sequence/define_assoc_tpl_struct.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace ns { struct x_member; diff --git a/test/sequence/define_assoc_tpl_struct_empty.cpp b/test/sequence/define_assoc_tpl_struct_empty.cpp index 70d6ca500..e0f29db4a 100644 --- a/test/sequence/define_assoc_tpl_struct_empty.cpp +++ b/test/sequence/define_assoc_tpl_struct_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, ) int diff --git a/test/sequence/define_assoc_tpl_struct_move.cpp b/test/sequence/define_assoc_tpl_struct_move.cpp index dcffa5663..dd2330b3f 100644 --- a/test/sequence/define_assoc_tpl_struct_move.cpp +++ b/test/sequence/define_assoc_tpl_struct_move.cpp @@ -12,6 +12,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct key_type; struct wrapper { diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 1243b9fe1..bd5f3c667 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_STRUCT( (ns), point, diff --git a/test/sequence/define_struct_empty.cpp b/test/sequence/define_struct_empty.cpp index 1468b9174..fab2c72ea 100644 --- a/test/sequence/define_struct_empty.cpp +++ b/test/sequence/define_struct_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), empty_struct, ) int diff --git a/test/sequence/define_struct_inline.cpp b/test/sequence/define_struct_inline.cpp index 4a3793b7e..8160652b6 100644 --- a/test/sequence/define_struct_inline.cpp +++ b/test/sequence/define_struct_inline.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct cls { BOOST_FUSION_DEFINE_STRUCT_INLINE( diff --git a/test/sequence/define_struct_inline_empty.cpp b/test/sequence/define_struct_inline_empty.cpp index 4168770a9..2117c9498 100644 --- a/test/sequence/define_struct_inline_empty.cpp +++ b/test/sequence/define_struct_inline_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, ) int diff --git a/test/sequence/define_struct_inline_move.cpp b/test/sequence/define_struct_inline_move.cpp index 3c7074042..de0f906e4 100644 --- a/test/sequence/define_struct_inline_move.cpp +++ b/test/sequence/define_struct_inline_move.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct wrapper { int value; diff --git a/test/sequence/define_struct_move.cpp b/test/sequence/define_struct_move.cpp index 8732b59b1..7caf38b6f 100644 --- a/test/sequence/define_struct_move.cpp +++ b/test/sequence/define_struct_move.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct wrapper { int value; diff --git a/test/sequence/define_tpl_struct.cpp b/test/sequence/define_tpl_struct.cpp index b47ac6110..8df7c4687 100644 --- a/test/sequence/define_tpl_struct.cpp +++ b/test/sequence/define_tpl_struct.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_TPL_STRUCT( (X)(Y), (ns), diff --git a/test/sequence/define_tpl_struct_empty.cpp b/test/sequence/define_tpl_struct_empty.cpp index d8cf47dec..aa81cae61 100644 --- a/test/sequence/define_tpl_struct_empty.cpp +++ b/test/sequence/define_tpl_struct_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, ) int diff --git a/test/sequence/define_tpl_struct_inline.cpp b/test/sequence/define_tpl_struct_inline.cpp index 3a7c69e3e..0109a2ebe 100644 --- a/test/sequence/define_tpl_struct_inline.cpp +++ b/test/sequence/define_tpl_struct_inline.cpp @@ -17,6 +17,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct cls { BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE( diff --git a/test/sequence/define_tpl_struct_inline_empty.cpp b/test/sequence/define_tpl_struct_inline_empty.cpp index 5cc0163fe..67e68fd87 100644 --- a/test/sequence/define_tpl_struct_inline_empty.cpp +++ b/test/sequence/define_tpl_struct_inline_empty.cpp @@ -16,6 +16,8 @@ #include #include +#include "with_or_without_fallback.hpp" + BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE((M), empty_struct, ) int diff --git a/test/sequence/define_tpl_struct_inline_move.cpp b/test/sequence/define_tpl_struct_inline_move.cpp index 39a00079a..e9d069334 100644 --- a/test/sequence/define_tpl_struct_inline_move.cpp +++ b/test/sequence/define_tpl_struct_inline_move.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct wrapper { int value; diff --git a/test/sequence/define_tpl_struct_move.cpp b/test/sequence/define_tpl_struct_move.cpp index c4dd9ab63..392e3c99d 100644 --- a/test/sequence/define_tpl_struct_move.cpp +++ b/test/sequence/define_tpl_struct_move.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct wrapper { int value; diff --git a/test/sequence/deque_comparison.cpp b/test/sequence/deque_comparison.cpp index 9bbf4fd95..f99790822 100644 --- a/test/sequence/deque_comparison.cpp +++ b/test/sequence/deque_comparison.cpp @@ -8,6 +8,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "comparison.hpp" diff --git a/test/sequence/deque_construction.cpp b/test/sequence/deque_construction.cpp index 4fc8c8830..0986e097c 100644 --- a/test/sequence/deque_construction.cpp +++ b/test/sequence/deque_construction.cpp @@ -8,6 +8,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "construction.hpp" diff --git a/test/sequence/deque_copy.cpp b/test/sequence/deque_copy.cpp index 5c48d5ecc..2a2f45633 100644 --- a/test/sequence/deque_copy.cpp +++ b/test/sequence/deque_copy.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "copy.hpp" diff --git a/test/sequence/deque_hash.cpp b/test/sequence/deque_hash.cpp index 01b36660a..1fed0e50d 100644 --- a/test/sequence/deque_hash.cpp +++ b/test/sequence/deque_hash.cpp @@ -6,6 +6,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "hash.hpp" diff --git a/test/sequence/deque_is_constructible.cpp b/test/sequence/deque_is_constructible.cpp index e08b4787e..f34947e37 100644 --- a/test/sequence/deque_is_constructible.cpp +++ b/test/sequence/deque_is_constructible.cpp @@ -10,9 +10,12 @@ #ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS #include #include +#include +#include "with_or_without_fallback.hpp" struct Dummy { }; +BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(Dummy) // Make sure deque's constructor is SFINAE-friendly. static_assert(!std::is_constructible, Dummy const&>::value, ""); diff --git a/test/sequence/deque_iterator.cpp b/test/sequence/deque_iterator.cpp index 10ce27f8b..52dbd2996 100644 --- a/test/sequence/deque_iterator.cpp +++ b/test/sequence/deque_iterator.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #define FUSION_TRAVERSAL_TAG bidirectional_traversal_tag #include "./iterator.hpp" diff --git a/test/sequence/deque_make.cpp b/test/sequence/deque_make.cpp index fe5705335..e91fe7073 100644 --- a/test/sequence/deque_make.cpp +++ b/test/sequence/deque_make.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "make.hpp" diff --git a/test/sequence/deque_misc.cpp b/test/sequence/deque_misc.cpp index 402afaccc..0d00c703a 100644 --- a/test/sequence/deque_misc.cpp +++ b/test/sequence/deque_misc.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define BOOST_FUSION_SEQUENCE_CONVERSION_IS_NOT_SEQUENCE__TYPE_PRESERVING #define FUSION_SEQUENCE deque diff --git a/test/sequence/deque_move.cpp b/test/sequence/deque_move.cpp index b3bdf11b7..49ac89944 100644 --- a/test/sequence/deque_move.cpp +++ b/test/sequence/deque_move.cpp @@ -8,6 +8,8 @@ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::deque> #define FUSION_SEQUENCE2 boost::fusion::deque, x> diff --git a/test/sequence/deque_mutate.cpp b/test/sequence/deque_mutate.cpp index ff145061b..68563c930 100644 --- a/test/sequence/deque_mutate.cpp +++ b/test/sequence/deque_mutate.cpp @@ -8,6 +8,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "mutate.hpp" diff --git a/test/sequence/deque_nest.cpp b/test/sequence/deque_nest.cpp index fd69d151f..c74c2c1de 100644 --- a/test/sequence/deque_nest.cpp +++ b/test/sequence/deque_nest.cpp @@ -7,6 +7,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::deque #include "nest.hpp" diff --git a/test/sequence/deque_tie.cpp b/test/sequence/deque_tie.cpp index f6ee91600..28d9b5c71 100644 --- a/test/sequence/deque_tie.cpp +++ b/test/sequence/deque_tie.cpp @@ -11,6 +11,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "tie.hpp" diff --git a/test/sequence/deque_value_at.cpp b/test/sequence/deque_value_at.cpp index 5b31504fb..40a4ce4ec 100644 --- a/test/sequence/deque_value_at.cpp +++ b/test/sequence/deque_value_at.cpp @@ -8,6 +8,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE deque #include "value_at.hpp" diff --git a/test/sequence/filter_view.cpp b/test/sequence/filter_view.cpp index 8ebe14767..de3eeedb8 100644 --- a/test/sequence/filter_view.cpp +++ b/test/sequence/filter_view.cpp @@ -28,6 +28,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct X { operator char const*() const diff --git a/test/sequence/flatten_view.cpp b/test/sequence/flatten_view.cpp index da8e65273..defa59722 100644 --- a/test/sequence/flatten_view.cpp +++ b/test/sequence/flatten_view.cpp @@ -19,6 +19,7 @@ #include #include +#include "with_or_without_fallback.hpp" int main() { diff --git a/test/sequence/front_extended_deque.cpp b/test/sequence/front_extended_deque.cpp index cdbedeb3b..d44600d21 100644 --- a/test/sequence/front_extended_deque.cpp +++ b/test/sequence/front_extended_deque.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/github-159.cpp b/test/sequence/github-159.cpp index e21d80c5c..a02d5a22e 100644 --- a/test/sequence/github-159.cpp +++ b/test/sequence/github-159.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { boost::fusion::vector v1; diff --git a/test/sequence/github-176.cpp b/test/sequence/github-176.cpp index 3f57df278..8363136c6 100644 --- a/test/sequence/github-176.cpp +++ b/test/sequence/github-176.cpp @@ -15,6 +15,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template void test_at() { diff --git a/test/sequence/hash.cpp b/test/sequence/hash.cpp index 30b44055a..d839499f2 100644 --- a/test/sequence/hash.cpp +++ b/test/sequence/hash.cpp @@ -11,6 +11,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct test_struct { test_struct(bool bb, int ii, char cc, std::string const& ss) : diff --git a/test/sequence/identity_view.cpp b/test/sequence/identity_view.cpp index e74f9294f..1c39e51aa 100644 --- a/test/sequence/identity_view.cpp +++ b/test/sequence/identity_view.cpp @@ -41,6 +41,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct abstract { virtual void foo() = 0; diff --git a/test/sequence/io.cpp b/test/sequence/io.cpp index d14f2af39..1d0f00042 100644 --- a/test/sequence/io.cpp +++ b/test/sequence/io.cpp @@ -22,6 +22,8 @@ # include #endif +#include "with_or_without_fallback.hpp" + using boost::fusion::vector; using boost::fusion::make_vector; using boost::fusion::tuple_close; diff --git a/test/sequence/iterator_range.cpp b/test/sequence/iterator_range.cpp index 18f91af0a..f23eae7ad 100644 --- a/test/sequence/iterator_range.cpp +++ b/test/sequence/iterator_range.cpp @@ -24,6 +24,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/joint_view.cpp b/test/sequence/joint_view.cpp index ba5659b74..5e20ddbee 100644 --- a/test/sequence/joint_view.cpp +++ b/test/sequence/joint_view.cpp @@ -22,6 +22,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct X { operator char const*() const diff --git a/test/sequence/list_comparison.cpp b/test/sequence/list_comparison.cpp index 2a02eba01..a276f9c45 100644 --- a/test/sequence/list_comparison.cpp +++ b/test/sequence/list_comparison.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "comparison.hpp" diff --git a/test/sequence/list_construction.cpp b/test/sequence/list_construction.cpp index a10b1e1a9..0a1ffa859 100644 --- a/test/sequence/list_construction.cpp +++ b/test/sequence/list_construction.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "construction.hpp" diff --git a/test/sequence/list_copy.cpp b/test/sequence/list_copy.cpp index 797089e9c..9505d303c 100644 --- a/test/sequence/list_copy.cpp +++ b/test/sequence/list_copy.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "copy.hpp" diff --git a/test/sequence/list_hash.cpp b/test/sequence/list_hash.cpp index 51203b273..1330d92c1 100644 --- a/test/sequence/list_hash.cpp +++ b/test/sequence/list_hash.cpp @@ -6,6 +6,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "hash.hpp" diff --git a/test/sequence/list_iterator.cpp b/test/sequence/list_iterator.cpp index 62d670878..283a43cd5 100644 --- a/test/sequence/list_iterator.cpp +++ b/test/sequence/list_iterator.cpp @@ -6,6 +6,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #define FUSION_NO_PRIOR #define FUSION_TRAVERSAL_TAG forward_traversal_tag diff --git a/test/sequence/list_make.cpp b/test/sequence/list_make.cpp index 296b6063e..f652756c9 100644 --- a/test/sequence/list_make.cpp +++ b/test/sequence/list_make.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "make.hpp" diff --git a/test/sequence/list_misc.cpp b/test/sequence/list_misc.cpp index 28d84854b..53e8d2496 100644 --- a/test/sequence/list_misc.cpp +++ b/test/sequence/list_misc.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #define FUSION_FORWARD_ONLY #include "misc.hpp" diff --git a/test/sequence/list_mutate.cpp b/test/sequence/list_mutate.cpp index b2736679c..8a8d6b0dd 100644 --- a/test/sequence/list_mutate.cpp +++ b/test/sequence/list_mutate.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "mutate.hpp" diff --git a/test/sequence/list_nest.cpp b/test/sequence/list_nest.cpp index 82df4864f..669622b52 100644 --- a/test/sequence/list_nest.cpp +++ b/test/sequence/list_nest.cpp @@ -7,6 +7,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::list #include "nest.hpp" diff --git a/test/sequence/list_tie.cpp b/test/sequence/list_tie.cpp index 30c8ed83d..c6bedab00 100644 --- a/test/sequence/list_tie.cpp +++ b/test/sequence/list_tie.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "tie.hpp" diff --git a/test/sequence/list_value_at.cpp b/test/sequence/list_value_at.cpp index 487968dae..daf4c2e59 100644 --- a/test/sequence/list_value_at.cpp +++ b/test/sequence/list_value_at.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "value_at.hpp" diff --git a/test/sequence/make_list.cpp b/test/sequence/make_list.cpp index 296b6063e..f652756c9 100644 --- a/test/sequence/make_list.cpp +++ b/test/sequence/make_list.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE list #include "make.hpp" diff --git a/test/sequence/make_vector.cpp b/test/sequence/make_vector.cpp index 8a687354a..19fa68c97 100644 --- a/test/sequence/make_vector.cpp +++ b/test/sequence/make_vector.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "make.hpp" diff --git a/test/sequence/map.cpp b/test/sequence/map.cpp index 5a130f8b3..9e026829c 100644 --- a/test/sequence/map.cpp +++ b/test/sequence/map.cpp @@ -25,6 +25,7 @@ #include #include +#include "with_or_without_fallback.hpp" struct copy_all { diff --git a/test/sequence/map_comparison.cpp b/test/sequence/map_comparison.cpp index 63f395153..cb04c37d6 100644 --- a/test/sequence/map_comparison.cpp +++ b/test/sequence/map_comparison.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct key1 {}; struct key2 {}; struct key3 {}; diff --git a/test/sequence/map_construction.cpp b/test/sequence/map_construction.cpp index 9c03b4268..fb3201b67 100644 --- a/test/sequence/map_construction.cpp +++ b/test/sequence/map_construction.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct key1 {}; struct key2 {}; struct key3 {}; diff --git a/test/sequence/map_copy.cpp b/test/sequence/map_copy.cpp index b8218bdf2..050dd06f4 100644 --- a/test/sequence/map_copy.cpp +++ b/test/sequence/map_copy.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct k1 {}; struct k2 {}; struct k3 {}; diff --git a/test/sequence/map_misc.cpp b/test/sequence/map_misc.cpp index 81da97539..bc49ff8d0 100644 --- a/test/sequence/map_misc.cpp +++ b/test/sequence/map_misc.cpp @@ -20,6 +20,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct k1 {}; struct k2 {}; struct k3 {}; diff --git a/test/sequence/map_move.cpp b/test/sequence/map_move.cpp index 9f9dd004f..769cf4450 100644 --- a/test/sequence/map_move.cpp +++ b/test/sequence/map_move.cpp @@ -8,6 +8,8 @@ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include +#include "with_or_without_fallback.hpp" + struct k1 {}; struct k2 {}; diff --git a/test/sequence/map_mutate.cpp b/test/sequence/map_mutate.cpp index 68c27133b..7d3164d5f 100644 --- a/test/sequence/map_mutate.cpp +++ b/test/sequence/map_mutate.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct k1 {}; struct k2 {}; struct k3 {}; diff --git a/test/sequence/map_tie.cpp b/test/sequence/map_tie.cpp index a3547375f..db4ff2419 100644 --- a/test/sequence/map_tie.cpp +++ b/test/sequence/map_tie.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct key_zero; struct key_one; diff --git a/test/sequence/nil.cpp b/test/sequence/nil.cpp index bdc8c3528..c5bca9237 100644 --- a/test/sequence/nil.cpp +++ b/test/sequence/nil.cpp @@ -10,6 +10,7 @@ #include #include +#include "with_or_without_fallback.hpp" int main() { using namespace boost::fusion; diff --git a/test/sequence/nview.cpp b/test/sequence/nview.cpp index dab982a52..a826b7967 100644 --- a/test/sequence/nview.cpp +++ b/test/sequence/nview.cpp @@ -15,6 +15,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct test { int int_; std::string string_; diff --git a/test/sequence/ref_vector.cpp b/test/sequence/ref_vector.cpp index 8bd0929b8..596e3ec07 100644 --- a/test/sequence/ref_vector.cpp +++ b/test/sequence/ref_vector.cpp @@ -13,6 +13,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct foo { double d; float f; short c; diff --git a/test/sequence/repetitive_view.cpp b/test/sequence/repetitive_view.cpp index 54da37bc8..8c1d718c8 100644 --- a/test/sequence/repetitive_view.cpp +++ b/test/sequence/repetitive_view.cpp @@ -21,6 +21,8 @@ #include +#include "with_or_without_fallback.hpp" + struct check_equal { template diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index 356b9b0bf..041b23e5a 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -28,6 +28,7 @@ #include #include +#include "with_or_without_fallback.hpp" int main() diff --git a/test/sequence/segmented_iterator_range.cpp b/test/sequence/segmented_iterator_range.cpp index 236a7e27d..2ecb8d2c4 100644 --- a/test/sequence/segmented_iterator_range.cpp +++ b/test/sequence/segmented_iterator_range.cpp @@ -19,8 +19,12 @@ #include #include #include + +#include "with_or_without_fallback.hpp" + #include "tree.hpp" + #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated. diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp index 714c36cda..19bd08857 100644 --- a/test/sequence/set.cpp +++ b/test/sequence/set.cpp @@ -25,6 +25,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/single_view.cpp b/test/sequence/single_view.cpp index 6fa517551..b2f7242c7 100644 --- a/test/sequence/single_view.cpp +++ b/test/sequence/single_view.cpp @@ -25,6 +25,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct X {}; template diff --git a/test/sequence/std_array.cpp b/test/sequence/std_array.cpp index 50e09b398..f292616d4 100644 --- a/test/sequence/std_array.cpp +++ b/test/sequence/std_array.cpp @@ -26,6 +26,8 @@ #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/std_pair.cpp b/test/sequence/std_pair.cpp index 647e9b00c..ca11ca4fd 100644 --- a/test/sequence/std_pair.cpp +++ b/test/sequence/std_pair.cpp @@ -31,6 +31,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/sequence/std_tuple.cpp b/test/sequence/std_tuple.cpp index 3d7110710..90d5bfc5d 100644 --- a/test/sequence/std_tuple.cpp +++ b/test/sequence/std_tuple.cpp @@ -21,6 +21,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/std_tuple_iterator.cpp b/test/sequence/std_tuple_iterator.cpp index df283331f..bea574248 100644 --- a/test/sequence/std_tuple_iterator.cpp +++ b/test/sequence/std_tuple_iterator.cpp @@ -15,6 +15,8 @@ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE std::tuple #define FUSION_TRAVERSAL_TAG random_access_traversal_tag #include "./iterator.hpp" diff --git a/test/sequence/transform_view.cpp b/test/sequence/transform_view.cpp index 4f11e6b77..657494c13 100644 --- a/test/sequence/transform_view.cpp +++ b/test/sequence/transform_view.cpp @@ -41,6 +41,8 @@ #include #include +#include "with_or_without_fallback.hpp" + struct square { template diff --git a/test/sequence/tuple_comparison.cpp b/test/sequence/tuple_comparison.cpp index 2b4433068..167a3cca0 100644 --- a/test/sequence/tuple_comparison.cpp +++ b/test/sequence/tuple_comparison.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #include "comparison.hpp" diff --git a/test/sequence/tuple_construction.cpp b/test/sequence/tuple_construction.cpp index 127720279..80098b438 100644 --- a/test/sequence/tuple_construction.cpp +++ b/test/sequence/tuple_construction.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define NO_CONSTRUCT_FROM_NIL #define FUSION_SEQUENCE tuple #define FUSION_AT get diff --git a/test/sequence/tuple_conversion.cpp b/test/sequence/tuple_conversion.cpp index 861365de4..74513ec8e 100644 --- a/test/sequence/tuple_conversion.cpp +++ b/test/sequence/tuple_conversion.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::tuple #include "conversion.hpp" diff --git a/test/sequence/tuple_copy.cpp b/test/sequence/tuple_copy.cpp index 012973876..219c3bc43 100644 --- a/test/sequence/tuple_copy.cpp +++ b/test/sequence/tuple_copy.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #define FUSION_AT get #define FUSION_MAKE make_tuple diff --git a/test/sequence/tuple_element.cpp b/test/sequence/tuple_element.cpp index 0932e627e..54cfcb562 100644 --- a/test/sequence/tuple_element.cpp +++ b/test/sequence/tuple_element.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #define FUSION_AT get #define FUSION_VALUE_AT(S, N) tuple_element diff --git a/test/sequence/tuple_hash.cpp b/test/sequence/tuple_hash.cpp index e8f604ef5..935a07a69 100644 --- a/test/sequence/tuple_hash.cpp +++ b/test/sequence/tuple_hash.cpp @@ -6,6 +6,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #include "hash.hpp" diff --git a/test/sequence/tuple_make.cpp b/test/sequence/tuple_make.cpp index 1a453b627..653c4c8ad 100644 --- a/test/sequence/tuple_make.cpp +++ b/test/sequence/tuple_make.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::tuple #define FUSION_AT get #define FUSION_MAKE boost::fusion::make_tuple diff --git a/test/sequence/tuple_misc.cpp b/test/sequence/tuple_misc.cpp index 473efb61c..ddf812f71 100644 --- a/test/sequence/tuple_misc.cpp +++ b/test/sequence/tuple_misc.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #define FUSION_AT get #define FUSION_SIZE tuple_size diff --git a/test/sequence/tuple_mutate.cpp b/test/sequence/tuple_mutate.cpp index b6e72a610..764251a84 100644 --- a/test/sequence/tuple_mutate.cpp +++ b/test/sequence/tuple_mutate.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #define FUSION_AT get #include "mutate.hpp" diff --git a/test/sequence/tuple_nest.cpp b/test/sequence/tuple_nest.cpp index 3344c5231..a41b6e049 100644 --- a/test/sequence/tuple_nest.cpp +++ b/test/sequence/tuple_nest.cpp @@ -7,6 +7,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::tuple #include "nest.hpp" diff --git a/test/sequence/tuple_tie.cpp b/test/sequence/tuple_tie.cpp index 2d5ec24f6..068e33096 100644 --- a/test/sequence/tuple_tie.cpp +++ b/test/sequence/tuple_tie.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE tuple #define FUSION_AT get #define FUSION_MAKE make_tuple diff --git a/test/sequence/tuple_traits.cpp b/test/sequence/tuple_traits.cpp index f065504a7..74cc7fcbe 100644 --- a/test/sequence/tuple_traits.cpp +++ b/test/sequence/tuple_traits.cpp @@ -11,6 +11,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::tuple #define FUSION_ALT_SEQUENCE boost::fusion::vector #include "traits.hpp" diff --git a/test/sequence/vector_comparison.cpp b/test/sequence/vector_comparison.cpp index c23db8336..87727fc0d 100644 --- a/test/sequence/vector_comparison.cpp +++ b/test/sequence/vector_comparison.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "comparison.hpp" diff --git a/test/sequence/vector_construction.cpp b/test/sequence/vector_construction.cpp index 8af5bc042..5706f9207 100644 --- a/test/sequence/vector_construction.cpp +++ b/test/sequence/vector_construction.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "construction.hpp" diff --git a/test/sequence/vector_conversion.cpp b/test/sequence/vector_conversion.cpp index 1ffd77cc6..c6322882f 100644 --- a/test/sequence/vector_conversion.cpp +++ b/test/sequence/vector_conversion.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::vector #include "conversion.hpp" diff --git a/test/sequence/vector_copy.cpp b/test/sequence/vector_copy.cpp index 8a4d26ce9..75071556b 100644 --- a/test/sequence/vector_copy.cpp +++ b/test/sequence/vector_copy.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "copy.hpp" diff --git a/test/sequence/vector_hash.cpp b/test/sequence/vector_hash.cpp index 6b6dcd24c..4074bfad8 100644 --- a/test/sequence/vector_hash.cpp +++ b/test/sequence/vector_hash.cpp @@ -6,6 +6,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "hash.hpp" diff --git a/test/sequence/vector_iterator.cpp b/test/sequence/vector_iterator.cpp index a2ca7df73..6514d304b 100644 --- a/test/sequence/vector_iterator.cpp +++ b/test/sequence/vector_iterator.cpp @@ -7,6 +7,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #define FUSION_TRAVERSAL_TAG random_access_traversal_tag #include "./iterator.hpp" diff --git a/test/sequence/vector_make.cpp b/test/sequence/vector_make.cpp index 8a687354a..19fa68c97 100644 --- a/test/sequence/vector_make.cpp +++ b/test/sequence/vector_make.cpp @@ -8,6 +8,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "make.hpp" diff --git a/test/sequence/vector_misc.cpp b/test/sequence/vector_misc.cpp index e2b273967..e65c5e380 100644 --- a/test/sequence/vector_misc.cpp +++ b/test/sequence/vector_misc.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "misc.hpp" diff --git a/test/sequence/vector_move.cpp b/test/sequence/vector_move.cpp index 3e9f0b6a7..5b180a635 100644 --- a/test/sequence/vector_move.cpp +++ b/test/sequence/vector_move.cpp @@ -8,6 +8,8 @@ #define BOOST_FUSION_DONT_USE_PREPROCESSED_FILES #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::vector> #define FUSION_SEQUENCE2 boost::fusion::vector, x> diff --git a/test/sequence/vector_mutate.cpp b/test/sequence/vector_mutate.cpp index 448bbf768..2180707a1 100644 --- a/test/sequence/vector_mutate.cpp +++ b/test/sequence/vector_mutate.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "mutate.hpp" diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp index 65e1032df..d4e00f76d 100644 --- a/test/sequence/vector_n.cpp +++ b/test/sequence/vector_n.cpp @@ -24,6 +24,7 @@ #include #include +#include "with_or_without_fallback.hpp" int main() diff --git a/test/sequence/vector_nest.cpp b/test/sequence/vector_nest.cpp index 2627b3d7c..dd84601a4 100644 --- a/test/sequence/vector_nest.cpp +++ b/test/sequence/vector_nest.cpp @@ -7,6 +7,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::vector #include "nest.hpp" diff --git a/test/sequence/vector_tie.cpp b/test/sequence/vector_tie.cpp index 123bf888e..5d0e8321d 100644 --- a/test/sequence/vector_tie.cpp +++ b/test/sequence/vector_tie.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "tie.hpp" diff --git a/test/sequence/vector_traits.cpp b/test/sequence/vector_traits.cpp index 470f11e69..e3222688f 100644 --- a/test/sequence/vector_traits.cpp +++ b/test/sequence/vector_traits.cpp @@ -9,6 +9,8 @@ #include #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE boost::fusion::vector #define FUSION_ALT_SEQUENCE boost::fusion::list #include "traits.hpp" diff --git a/test/sequence/vector_value_at.cpp b/test/sequence/vector_value_at.cpp index 191da4cf7..f0fa2cb37 100644 --- a/test/sequence/vector_value_at.cpp +++ b/test/sequence/vector_value_at.cpp @@ -7,6 +7,8 @@ ==============================================================================*/ #include +#include "with_or_without_fallback.hpp" + #define FUSION_SEQUENCE vector #include "value_at.hpp" diff --git a/test/sequence/zip_view.cpp b/test/sequence/zip_view.cpp index 83bfa8798..e420708e0 100644 --- a/test/sequence/zip_view.cpp +++ b/test/sequence/zip_view.cpp @@ -29,6 +29,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/test/sequence/zip_view2.cpp b/test/sequence/zip_view2.cpp index b63a27446..359e9023c 100644 --- a/test/sequence/zip_view2.cpp +++ b/test/sequence/zip_view2.cpp @@ -30,6 +30,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { { diff --git a/test/sequence/zip_view_ignore.cpp b/test/sequence/zip_view_ignore.cpp index d22bf70ff..49e93db66 100644 --- a/test/sequence/zip_view_ignore.cpp +++ b/test/sequence/zip_view_ignore.cpp @@ -15,6 +15,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { using namespace boost::fusion; diff --git a/util/test.jam b/util/test.jam index 5d971693b..56293b49c 100644 --- a/util/test.jam +++ b/util/test.jam @@ -43,5 +43,28 @@ rule test-bfl-run_with_and_without_fallback ( sources + : args * : input-files * return $(tests) ; } -# TODO: test-bfl-compile_with_and_without_fallback +rule test-bfl-compile_with_and_without_fallback ( sources : requirements * : target-name ? ) { + local tests ; + if ! $(target-name) + { + target-name = $(sources[1]:B) ; + } + tests += [ + compile + $(sources) + : BOOST_FUSION_DO_NOT_USE_TAG_OF_FALLBACK=1 + $(requirements) + : $(target-name)__normal + ] ; + tests += [ + compile + $(sources) + : BOOST_FUSION_USE_TAG_OF_FALLBACK=1 + $(requirements) + : $(target-name)__fallback + ] ; + return $(tests) ; +} + + # TODO: test-bfl-compile_strictly_without_fallback \ No newline at end of file From ff05040075434acfe581a2eef92630aa27c9beb0 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Mon, 23 Jan 2023 02:30:45 +0600 Subject: [PATCH 14/24] [pfr_implicit_explicit] Rest of regression tests --- test/Jamfile | 133 +++++++++--------- test/algorithm/all.cpp | 2 + test/algorithm/any.cpp | 2 + test/algorithm/clear.cpp | 2 + test/algorithm/copy.cpp | 2 + test/algorithm/count.cpp | 2 + test/algorithm/count_if.cpp | 2 + test/algorithm/erase.cpp | 2 + test/algorithm/erase_key.cpp | 6 +- test/algorithm/filter.cpp | 2 + test/algorithm/filter_if.cpp | 2 + test/algorithm/find.cpp | 2 + test/algorithm/find_if.cpp | 2 + test/algorithm/flatten.cpp | 1 + test/algorithm/fold.cpp | 2 + test/algorithm/for_each.cpp | 2 + test/algorithm/insert.cpp | 2 + test/algorithm/insert_range.cpp | 2 + test/algorithm/iter_fold.cpp | 2 + test/algorithm/join.cpp | 2 + test/algorithm/move.cpp | 2 + test/algorithm/none.cpp | 2 + test/algorithm/pop_back.cpp | 2 + test/algorithm/pop_front.cpp | 2 + test/algorithm/push_back.cpp | 2 + test/algorithm/push_front.cpp | 2 + test/algorithm/remove.cpp | 2 + test/algorithm/remove_if.cpp | 2 + test/algorithm/replace.cpp | 2 + test/algorithm/replace_if.cpp | 2 + test/algorithm/reverse.cpp | 2 + test/algorithm/reverse_fold.cpp | 2 + test/algorithm/reverse_iter_fold.cpp | 2 + test/algorithm/segmented_find.cpp | 3 + test/algorithm/segmented_find_if.cpp | 3 + test/algorithm/segmented_fold.cpp | 3 + test/algorithm/segmented_for_each.cpp | 3 + test/algorithm/ticket-5490.cpp | 2 + test/algorithm/transform.cpp | 2 + test/algorithm/with_or_without_fallback.hpp | 17 +++ test/algorithm/zip.cpp | 2 + test/algorithm/zip2.cpp | 2 + test/algorithm/zip_ignore.cpp | 2 + test/functional/fused.cpp | 2 + test/functional/fused_function_object.cpp | 2 + test/functional/fused_procedure.cpp | 2 + test/functional/invoke.cpp | 2 + test/functional/invoke_function_object.cpp | 2 + test/functional/invoke_procedure.cpp | 2 + test/functional/make_fused.cpp | 2 + .../functional/make_fused_function_object.cpp | 2 + test/functional/make_fused_procedure.cpp | 2 + test/functional/make_unfused.cpp | 1 + test/functional/unfused.cpp | 2 + test/functional/unfused_typed.cpp | 2 + test/functional/with_or_without_fallback.hpp | 17 +++ test/sequence/swap.cpp | 2 + test/support/and.cpp | 2 + test/support/index_sequence.cpp | 2 + test/support/is_sequence.cpp | 1 + test/support/is_view.cpp | 1 + test/support/pair_deque.cpp | 2 + test/support/pair_list.cpp | 2 + test/support/pair_map.cpp | 2 + test/support/pair_nest.cpp | 2 + test/support/pair_set.cpp | 2 + test/support/pair_vector.cpp | 2 + test/support/tag_of.cpp | 1 + test/support/unused.cpp | 2 + test/support/with_or_without_fallback.hpp | 17 +++ util/test.jam | 24 +++- 71 files changed, 273 insertions(+), 70 deletions(-) create mode 100644 test/algorithm/with_or_without_fallback.hpp create mode 100644 test/functional/with_or_without_fallback.hpp create mode 100644 test/support/with_or_without_fallback.hpp diff --git a/test/Jamfile b/test/Jamfile index b184af864..6b55996e3 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -16,6 +16,7 @@ import ../../config/checks/config : requires ; import ../util/test : test-bfl-run_with_and_without_fallback test-bfl-compile_with_and_without_fallback + test-bfl-compile_strictly_without_fallback ; if [ os.environ CI ] @@ -31,48 +32,48 @@ project { test-suite fusion : - [ run algorithm/all.cpp ] - [ run algorithm/any.cpp ] - [ run algorithm/clear.cpp ] - [ run algorithm/copy.cpp ] - [ run algorithm/count.cpp ] - [ run algorithm/count_if.cpp ] - [ run algorithm/erase.cpp ] - [ run algorithm/erase_key.cpp ] - [ run algorithm/filter.cpp ] - [ run algorithm/filter_if.cpp ] - [ run algorithm/find.cpp ] - [ run algorithm/find_if.cpp ] - [ run algorithm/fold.cpp ] - [ run algorithm/for_each.cpp ] - [ run algorithm/insert.cpp ] - [ run algorithm/insert_range.cpp ] - [ run algorithm/iter_fold.cpp ] - [ run algorithm/move.cpp : : + [ test-bfl-run_with_and_without_fallback algorithm/all.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/any.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/clear.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/copy.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/count.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/count_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/erase.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/erase_key.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/filter.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/filter_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/find.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/find_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/fold.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/for_each.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/insert.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/insert_range.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/iter_fold.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/move.cpp : : : [ requires cxx11_rvalue_references ] ] - [ run algorithm/none.cpp ] - [ run algorithm/pop_back.cpp ] - [ run algorithm/pop_front.cpp ] - [ run algorithm/push_back.cpp ] - [ run algorithm/push_front.cpp ] - [ run algorithm/remove.cpp ] - [ run algorithm/remove_if.cpp ] - [ run algorithm/replace.cpp ] - [ run algorithm/replace_if.cpp ] - [ run algorithm/reverse_fold.cpp ] - [ run algorithm/reverse_iter_fold.cpp ] - [ run algorithm/reverse.cpp ] - [ run algorithm/segmented_for_each.cpp ] - [ run algorithm/segmented_find.cpp ] - [ run algorithm/segmented_find_if.cpp ] - [ run algorithm/segmented_fold.cpp ] - [ run algorithm/transform.cpp ] - [ run algorithm/join.cpp ] - [ run algorithm/zip.cpp ] - [ run algorithm/zip2.cpp ] - [ run algorithm/zip_ignore.cpp ] - [ run algorithm/flatten.cpp ] - [ compile algorithm/ticket-5490.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/none.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/pop_back.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/pop_front.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/push_back.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/push_front.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/remove.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/remove_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/replace.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/replace_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/reverse_fold.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/reverse_iter_fold.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/reverse.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/segmented_for_each.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/segmented_find.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/segmented_find_if.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/segmented_fold.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/transform.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/join.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/zip.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/zip2.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/zip_ignore.cpp ] + [ test-bfl-run_with_and_without_fallback algorithm/flatten.cpp ] + [ test-bfl-compile_with_and_without_fallback algorithm/ticket-5490.cpp ] [ compile include/adapted.cpp ] [ compile include/_boost_pfr.cpp @@ -267,37 +268,37 @@ project [ test-bfl-compile_with_and_without_fallback sequence/size.cpp ] - [ run functional/fused.cpp ] - [ run functional/fused_function_object.cpp ] - [ run functional/fused_procedure.cpp ] - [ run functional/unfused.cpp ] - [ run functional/unfused_typed.cpp ] - [ run functional/make_fused.cpp ] - [ run functional/make_fused_function_object.cpp ] - [ run functional/make_fused_procedure.cpp ] - [ run functional/make_unfused.cpp ] - [ run functional/invoke.cpp ] - [ run functional/invoke_function_object.cpp ] - [ run functional/invoke_procedure.cpp ] - [ run sequence/swap.cpp ] + [ test-bfl-run_with_and_without_fallback functional/fused.cpp ] + [ test-bfl-run_with_and_without_fallback functional/fused_function_object.cpp ] + [ test-bfl-run_with_and_without_fallback functional/fused_procedure.cpp ] + [ test-bfl-run_with_and_without_fallback functional/unfused.cpp ] + [ test-bfl-run_with_and_without_fallback functional/unfused_typed.cpp ] + [ test-bfl-run_with_and_without_fallback functional/make_fused.cpp ] + [ test-bfl-run_with_and_without_fallback functional/make_fused_function_object.cpp ] + [ test-bfl-run_with_and_without_fallback functional/make_fused_procedure.cpp ] + [ test-bfl-run_with_and_without_fallback functional/make_unfused.cpp ] + [ test-bfl-run_with_and_without_fallback functional/invoke.cpp ] + [ test-bfl-run_with_and_without_fallback functional/invoke_function_object.cpp ] + [ test-bfl-run_with_and_without_fallback functional/invoke_procedure.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/swap.cpp ] [ run support/config.cpp ] [ compile support/config_pfr_0.cpp ] [ compile support/config_pfr_1.cpp ] - [ compile support/is_sequence.cpp ] - [ compile support/is_view.cpp ] - [ compile support/pair_deque.cpp ] - [ compile support/pair_list.cpp ] - [ compile support/pair_map.cpp ] - [ compile support/pair_set.cpp ] - [ compile support/pair_vector.cpp ] - [ compile support/pair_nest.cpp ] - [ compile support/index_sequence.cpp + [ test-bfl-compile_strictly_without_fallback support/is_sequence.cpp ] + [ test-bfl-compile_strictly_without_fallback support/is_view.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_deque.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_list.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_map.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_set.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_vector.cpp ] + [ test-bfl-compile_with_and_without_fallback support/pair_nest.cpp ] + [ test-bfl-compile_with_and_without_fallback support/index_sequence.cpp : [ requires cxx11_variadic_templates ] ] - [ compile support/and.cpp + [ test-bfl-compile_with_and_without_fallback support/and.cpp : [ requires cxx11_variadic_templates ] ] - [ compile support/tag_of.cpp ] - [ compile support/unused.cpp ] + [ test-bfl-compile_strictly_without_fallback support/tag_of.cpp ] + [ test-bfl-compile_with_and_without_fallback support/unused.cpp ] [ compile support/detail/tag_of_fallback.cpp ] # [ compile-fail xxx.cpp ] diff --git a/test/algorithm/all.cpp b/test/algorithm/all.cpp index 7b5550732..ed9139867 100644 --- a/test/algorithm/all.cpp +++ b/test/algorithm/all.cpp @@ -12,6 +12,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace { struct search_for diff --git a/test/algorithm/any.cpp b/test/algorithm/any.cpp index da0aa7933..76589f5d0 100644 --- a/test/algorithm/any.cpp +++ b/test/algorithm/any.cpp @@ -13,6 +13,8 @@ #include #include +#include "with_or_without_fallback.hpp" + namespace { struct search_for diff --git a/test/algorithm/clear.cpp b/test/algorithm/clear.cpp index f90f5c0a6..9d661c83d 100644 --- a/test/algorithm/clear.cpp +++ b/test/algorithm/clear.cpp @@ -12,6 +12,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/algorithm/copy.cpp b/test/algorithm/copy.cpp index 330caca62..4d615075f 100644 --- a/test/algorithm/copy.cpp +++ b/test/algorithm/copy.cpp @@ -10,6 +10,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/algorithm/count.cpp b/test/algorithm/count.cpp index 13aaad1a6..4cd3eb678 100644 --- a/test/algorithm/count.cpp +++ b/test/algorithm/count.cpp @@ -12,6 +12,8 @@ #include #include +#include "with_or_without_fallback.hpp" + int main() { diff --git a/test/algorithm/count_if.cpp b/test/algorithm/count_if.cpp index 7555f6fcb..e0ebaf733 100644 --- a/test/algorithm/count_if.cpp +++ b/test/algorithm/count_if.cpp @@ -12,6 +12,8 @@ #include #include +#include "with_or_without_fallback.hpp" + template struct bind1st; template