mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
Enable more tests for loophole
This commit is contained in:
@@ -20,9 +20,9 @@ static_assert(std::is_same<
|
||||
>::value, "");
|
||||
|
||||
|
||||
// Requires C++17:
|
||||
// Requires C++17 or Loophole enabled:
|
||||
//<-
|
||||
#if BOOST_PFR_USE_CPP17 //->
|
||||
#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE //->
|
||||
static_assert(std::is_same<
|
||||
boost::pfr::tuple_element_t<1, foo_t>, // Precise reflection.
|
||||
nested_t
|
||||
|
||||
@@ -65,7 +65,7 @@ void test_examples() {
|
||||
std::cout << "boost::pfr::flat_structure_tie(var) :\n" << var << '\n';
|
||||
}
|
||||
|
||||
#if BOOST_PFR_USE_CPP17
|
||||
#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE
|
||||
{
|
||||
//[pfr_quick_examples_ops
|
||||
struct test { std::string f1; std::string_view f2; };
|
||||
@@ -137,7 +137,7 @@ void test_examples() {
|
||||
//]
|
||||
}
|
||||
|
||||
#if BOOST_PFR_USE_CPP17
|
||||
#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE
|
||||
{
|
||||
bar var{'A', {777, 3.141593}};
|
||||
//[pfr_quick_examples_get_1
|
||||
@@ -172,7 +172,7 @@ void test_examples() {
|
||||
std::cout << "boost::pfr::flat_get<1>(var.f) outputs:\n" << var << '\n';
|
||||
}
|
||||
|
||||
#if BOOST_PFR_USE_CPP17
|
||||
#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE
|
||||
{
|
||||
bar var{'A', {777, 3.141593}};
|
||||
//[pfr_quick_examples_structure_to_tuple
|
||||
@@ -192,7 +192,7 @@ void test_examples() {
|
||||
std::cout << "boost::pfr::flat_structure_to_tuple(var) :\n" << var << '\n';
|
||||
}
|
||||
|
||||
#if BOOST_PFR_USE_CPP17
|
||||
#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_LOOPHOLE
|
||||
{
|
||||
bar var{'A', {777, 3.141593}};
|
||||
//[pfr_quick_examples_structure_tie
|
||||
|
||||
Reference in New Issue
Block a user