diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 old mode 100644 new mode 100755 index 21ff053..b1e1558 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -53,6 +53,8 @@ test-suite pfr_tests [ run offset_based_getter.cpp ] + [ run can_be_as_fallback_in_the_fusion.cpp ] + [ run test_tuple_sizes_on.cpp : : : BOOST_PFR_RUN_TEST_ON=char : test_tuple_sizes_on_chars ] [ run test_tuple_sizes_on.cpp : : : BOOST_PFR_RUN_TEST_ON=int : test_tuple_sizes_on_ints ] [ run test_tuple_sizes_on.cpp : : : BOOST_PFR_RUN_TEST_ON=short : test_tuple_sizes_on_shorts ] diff --git a/test/can_be_as_fallback_in_the_fusion.cpp b/test/can_be_as_fallback_in_the_fusion.cpp new file mode 100755 index 0000000..545b414 --- /dev/null +++ b/test/can_be_as_fallback_in_the_fusion.cpp @@ -0,0 +1,33 @@ +// Copyright (c) 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 + +struct Aggregate {}; +using NonAggregate = int; + +namespace boost { namespace pfr { + struct boost_fusion_tag; +}} + +template +struct tag_of_fallback : std::false_type { +}; + +template +struct tag_of_fallback::value>> +{ + using type = std::conditional_t< + boost::pfr::is_implicitly_reflectable::value + , std::true_type + , std::false_type + >; +}; + +static_assert(tag_of_fallback::type{} == true, ""); +static_assert(tag_of_fallback::type{} == false, ""); + +int main() { }