2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00
This commit is contained in:
Antony Polukhin
2023-08-10 17:22:31 +03:00
committed by GitHub
parent 275eabb7ed
commit 963460a3c1
2 changed files with 49 additions and 35 deletions

View File

@@ -15,13 +15,23 @@ struct TestStruct {
std::vector<std::unique_ptr<int>> vec;
};
int main() {
TestStruct temp;
temp.vec.emplace_back();
// FIXME: https://github.com/boostorg/pfr/issues/131
#if defined(__clang__) && __cplusplus >= 202002L
# if BOOST_PFR_USE_LOOPHOLE == 0 && BOOST_PFR_USE_CPP17 == 0
# error This test should fail on classic engine
#endif
#else
boost::pfr::for_each_field(temp, [](const auto& value) {
BOOST_TEST_EQ(value.size(), 1);
});
#endif
return boost::report_errors();
}