mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
Return std::array<std::string_view, 0> type for boost::pfr::names_as_array(empty_struct{}) (fixes #195)
This commit is contained in:
@@ -131,6 +131,13 @@ void test_names_as_array_for_empty() {
|
||||
BOOST_TEST_EQ(value.empty(), true);
|
||||
}
|
||||
|
||||
void test_names_as_array_iteration_for_empty() {
|
||||
const auto names = boost::pfr::names_as_array<empty>();
|
||||
for (std::string_view name : names) {
|
||||
BOOST_ERROR("`names` must be empty");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
|
||||
int main() {
|
||||
@@ -141,6 +148,7 @@ int main() {
|
||||
testing::test_names_as_array();
|
||||
testing::test_names_as_array_without_linkage();
|
||||
testing::test_names_as_array_for_empty();
|
||||
testing::test_names_as_array_iteration_for_empty();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user