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 diff --git a/doc/adapted.qbk b/doc/adapted.qbk index d14086196..11a879ed7 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) 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 @@ -23,6 +24,20 @@ 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_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] This module provides adapters for arrays. Including the module @@ -208,6 +223,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(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.] + +[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 +369,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 +454,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 +1601,186 @@ defined in __random_access_sequence__ and __associative_sequence__. [endsect] +[section:force_pfr_reflectable BOOST_FUSION_FORCE_PFR_REFLECTABLE] + +[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 satisfying __simple_aggregate__ to be specifyed. + +[heading Header] + + #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] + +[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 + +[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] + +[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 satisfying __simple_aggregate__ to be specifyed. + +[heading Header] + + #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] + +[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 + +[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..c5b513f3e 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-2023. [endsect] diff --git a/include/boost/fusion/adapted.hpp b/include/boost/fusion/adapted.hpp index 5bc33899c..2d983a1c2 100644 --- a/include/boost/fusion/adapted.hpp +++ b/include/boost/fusion/adapted.hpp @@ -23,4 +23,17 @@ #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 #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..cf97d2ef6 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..d827908d8 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/boost_pfr_iterator.hpp @@ -0,0 +1,108 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..ac9677463 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/at_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..d94d09fa5 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/begin_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..8bb02e632 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/category_of_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..f2c81a9cd --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/end_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..bf70f390e --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_sequence_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..2d53e5685 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/is_view_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..6ba714c0d --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/size_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..2a47f2c24 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/detail/value_at_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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 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..36478cafa --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/force.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_FORCE_HPP + +#include + +#if BOOST_FUSION_PFR_ENABLED +#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 \ + { \ + }; \ + }} + +#else + +#define BOOST_FUSION_FORCE_PFR_REFLECTABLE(NAME) +#define BOOST_FUSION_FORCE_PFR_NONREFLECTABLE(NAME) +#define BOOST_FUSION_FORCE_PFR_REFLECTABLE_TPL(NAME) +#define BOOST_FUSION_FORCE_PFR_NONREFLECTABLE_TPL(NAME) + +#endif + +#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 new file mode 100644 index 000000000..6529b75cb --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/tag_of.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..a700d9057 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr/tag_of_fallback.hpp @@ -0,0 +1,94 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_FALLBACK_HPP +#define BOOST_FUSION_ADAPTED_BOOST_PFR_TAG_OF_FALLBACK_HPP + +#include +#include +#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 + { + // 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 + struct constexpr_in_namespace_check_possible { + template ("") > + static std::true_type test(long) noexcept; + + static std::false_type test(...) noexcept; + + static constexpr bool value = decltype(test(0)){}; + }; + + template + constexpr bool is_implicitly_reflectable_via_pfr() noexcept { + static_assert(detail::constexpr_in_namespace_check_possible::value + , "Unfortunately, Boost PFR with implicit reflection won't work in your compiler due to constexpr limitations. " + "Please, try to use another compiler or disable implicit reflection by '-DBOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION=0'"); + static_assert(boost::is_complete::value + , "Boost Fusion doesn't work with incomplete types if Boost PFR is used as implicit fallback. " + "Please, don't pass incomplete types into Boost Fusion or just disable implicit reflection by '-DBOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION=0'"); + 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()>> + { + using type = boost_pfr_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..0e31d8065 --- /dev/null +++ b/include/boost/fusion/adapted/boost_pfr_explicit.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..d70d91b0c --- /dev/null +++ b/include/boost/fusion/include/boost_pfr.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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..f06f95deb --- /dev/null +++ b/include/boost/fusion/include/boost_pfr_explicit.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#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/include/boost_pfr_force.hpp b/include/boost/fusion/include/boost_pfr_force.hpp new file mode 100644 index 000000000..a9ca0e530 --- /dev/null +++ b/include/boost/fusion/include/boost_pfr_force.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_BOOST_PFR_FORCE_HPP +#define BOOST_FUSION_INCLUDE_BOOST_PFR_FORCE_HPP + +#include +#include + +#endif + diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index 7c87adeb9..f3e5a7e03 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,27 @@ namespace boost { namespace fusion { namespace detail # define BOOST_FUSION_DISABLE_MSVC_WARNING(num) #endif + +// Configure possible integration with PFR +#ifndef BOOST_FUSION_PFR_ENABLED +# 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_ENABLE_IMPLICIT_REFLECTION +#endif + +// Verify configuration of possible integration with PFR +#if BOOST_FUSION_PFR_ENABLED && !BOOST_PFR_ENABLED +#error Can not force to integrate Boost PFR with Boost Fusion because Boost PFR unavailable in this environment. +#endif + +#if BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION && !BOOST_PFR_ENABLE_IMPLICIT_REFLECTION +#error Can not force to integrate Boost PFR as implicit fallback for Boost Fusion because Boost PFR does not provide implicit reflection in this environment. +#endif + +#if BOOST_FUSION_PFR_ENABLE_IMPLICIT_REFLECTION && !BOOST_FUSION_PFR_ENABLED +#error Can not force to integrate Boost PFR as implicit fallback for Boost Fusion because Boost Fusion configured to not use whole Boost PFR. +#endif + #endif diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp old mode 100755 new mode 100644 index f9e578569..7e353be05 --- a/include/boost/fusion/support/tag_of.hpp +++ b/include/boost/fusion/support/tag_of.hpp @@ -48,7 +48,7 @@ namespace boost { namespace fusion { BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) - template + template struct tag_of_fallback { typedef non_fusion_tag type; diff --git a/include/boost/fusion/support/tag_of_fwd.hpp b/include/boost/fusion/support/tag_of_fwd.hpp index ba434d933..feb98a0f9 100644 --- a/include/boost/fusion/support/tag_of_fwd.hpp +++ b/include/boost/fusion/support/tag_of_fwd.hpp @@ -10,6 +10,12 @@ namespace boost { namespace fusion { + namespace detail + { + // This metafunction mustn't have more than one specialization in the whole Fusion + template + struct tag_of_fallback; + } namespace traits { template diff --git a/test/Jamfile b/test/Jamfile old mode 100755 new mode 100644 index 21944f24e..48525a7c7 --- a/test/Jamfile +++ b/test/Jamfile @@ -2,6 +2,7 @@ # Copyright (c) 2003-2006 Joel de Guzman # Copyright (c) 2013 Mateusz Loskot # Copyright (c) 2014-2018 Kohei Takahashi +# 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 @@ -12,11 +13,113 @@ 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 + test-bfl-compile_with_and_without_fallback + test-bfl-compile_strictly_without_fallback +; + if [ os.environ CI ] { CI_DEFINES = CI_SKIP_KNOWN_FAILURE=1 ; } +########## BEGIN of helpers to detect constexpr ctti_type_index trick support + +actions mp_simple_run_action +{ + $(>) > $(<) +} + +rule mp-run-simple ( sources + : args * : input-files * : requirements * : target-name ) +{ + exe $(target-name)_exe : $(sources) : $(requirements) ; + explicit $(target-name)_exe ; + make $(target-name).output : $(target-name)_exe : @mp_simple_run_action ; + explicit $(target-name).output ; + alias $(target-name) : $(target-name).output ; +} + +mp-run-simple constexpr_ctti_type_index_detection.cpp : : : : compiler_supports_constexpr_ctti_type_index ; +explicit compiler_supports_constexpr_ctti_type_index ; + +########## END of helpers to detect constexpr ctti_type_index trick support + +local REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX = + [ check-target-builds ../test//compiler_supports_constexpr_ctti_type_index : : no ] + ; + +local REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX_FAIL = + [ check-target-builds ../test//compiler_supports_constexpr_ctti_type_index : no : ] + ; + + +rule test-bfl-run_pfr_implicit ( sources + ) { + local tests ; + local target-name = $(sources[1]:B) ; + local VARIANTS = + IMPLICIT_0 + IMPLICIT_1 + IMPLICIT_2 + ; + for local variant in $(VARIANTS) + { + tests += [ + run + $(sources) : : + : BOOST_FUSION_USE_PFR_$(variant)=1 BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 $(REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX) [ requires cxx14_constexpr ] + : $(target-name)__$(variant:L) + ] ; + tests += [ + compile-fail + $(sources) + : BOOST_FUSION_USE_PFR_$(variant)=1 BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 $(REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX_FAIL) [ requires cxx14_constexpr ] + : $(target-name)__$(variant:L)_fail + ] ; + } + return $(tests) ; +} + +rule test-bfl-run_pfr_explicit ( sources + ) { + local tests ; + local target-name = $(sources[1]:B) ; + local VARIANTS = + EXPLICIT_0 + EXPLICIT_1 + EXPLICIT_2 + ; + for local variant in $(VARIANTS) + { + tests += [ + run + $(sources) : : + : BOOST_FUSION_USE_PFR_$(variant)=1 [ requires cxx14_constexpr ] + : $(target-name)__$(variant:L) + ] ; + } + return $(tests) ; +} + +rule test-bfl-run_pfr_only_force ( sources + ) { + local tests ; + local target-name = $(sources[1]:B) ; + local VARIANTS = + ONLY_FORCE_0 + ONLY_FORCE_1 + ; + for local variant in $(VARIANTS) + { + tests += [ + run + $(sources) : : + : BOOST_FUSION_USE_PFR_$(variant)=1 + : $(target-name)__$(variant:L) + ] ; + } + return $(tests) ; +} + project : requirements $(CI_DEFINES) @@ -25,252 +128,276 @@ 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 ] + + [ run sequence/detail/boost_pfr_utils.cpp : : + : BOOST_FUSION_EXPECT_CTTI_TYPE_INDEX_CONSTEXPR_WHEN_UTILS_TEST=1 BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 $(REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX) [ requires cxx14_constexpr ] + : detail_boost_pfr_utils_expect_constexpr_ctti_type_index + ] + [ run sequence/detail/boost_pfr_utils.cpp : : + : BOOST_FUSION_EXPECT_CTTI_TYPE_INDEX_NONCONSTEXPR_WHEN_UTILS_TEST=1 BOOST_PFR_ENABLE_IMPLICIT_REFLECTION=1 $(REQUIRE_CONSTEXPR_CTTI_TYPE_INDEX_FAIL) [ requires cxx14_constexpr ] + : detail_boost_pfr_utils_expect_nonconstexpr_ctti_type_index + ] - [ run sequence/as_deque.cpp ] - [ run sequence/as_list.cpp ] - [ run sequence/as_map.cpp ] - [ run sequence/as_map_assoc.cpp ] - [ run sequence/as_set.cpp ] - [ run sequence/as_vector.cpp ] - [ run sequence/boost_tuple.cpp ] - [ run sequence/boost_tuple_iterator.cpp ] - [ run sequence/cons.cpp ] - [ run sequence/convert_boost_tuple.cpp ] - [ run sequence/convert_deque.cpp ] - [ run sequence/convert_list.cpp ] - [ run sequence/convert_std_pair.cpp ] - [ run sequence/convert_std_tuple.cpp : : + [ 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 ] + [ test-bfl-run_pfr_implicit sequence/boost_pfr.cpp ] + [ test-bfl-run_pfr_implicit sequence/boost_pfr_empty.cpp ] + [ test-bfl-run_pfr_implicit sequence/boost_pfr_convert.cpp ] + [ test-bfl-run_pfr_explicit sequence/boost_pfr_iterator.cpp ] + [ test-bfl-run_pfr_explicit sequence/boost_pfr_force_macro.cpp ] + [ test-bfl-run_pfr_explicit sequence/boost_pfr_explicit.cpp ] + [ test-bfl-run_pfr_only_force sequence/boost_pfr_force_macro_only.cpp ] + # FIXME it doesn't work properly due to issue on PFR side + # [ test-bfl-run_pfr_implicit sequence/boost_pfr_reference.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 ] - [ 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/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 ] + [ 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 : : : [ 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 ] - [ compile sequence/github-159.cpp ] - [ run sequence/github-176.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/ref_vector.cpp ] + [ test-bfl-run_with_and_without_fallback sequence/flatten_view.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 ] - [ 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 ] - [ 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 + [ run support/config.cpp : : : always_show_run_output ] + [ compile support/config_pfr_0.cpp ] + [ compile support/config_pfr_1.cpp ] + [ compile-fail support/config_pfr_fail_0.cpp ] + [ compile-fail support/config_pfr_fail_1.cpp ] + [ compile-fail support/config_pfr_fail_2.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..d69601fb4 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..44a483168 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..87e293c9e 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..0484fc5fb 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..5546ac1b2 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..fdb9b2fd1 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