From c951f22eb731199f72f01bddc7a634d39736d330 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 6 Jan 2026 21:10:06 +0300 Subject: [PATCH] Update member_to_index.cpp --- test/core/run/member_to_index.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/core/run/member_to_index.cpp b/test/core/run/member_to_index.cpp index 3def082..72b1333 100644 --- a/test/core/run/member_to_index.cpp +++ b/test/core/run/member_to_index.cpp @@ -5,6 +5,7 @@ #include +#include #include #include @@ -15,7 +16,14 @@ struct Sample { }; int main() { +#if BOOST_PFR_USE_CPP17 || BOOST_PFR_USE_CPP26 static_assert(boost::pfr::index_of(&Sample::x) == 0); static_assert(boost::pfr::index_of(&Sample::y) == 1); static_assert(boost::pfr::index_of(&Sample::z) == 2); +#else + assert(boost::pfr::index_of(&Sample::x) == 0); + = 0 + assert(boost::pfr::index_of(&Sample::y) == 1); + assert(boost::pfr::index_of(&Sample::z) == 2); +#endif }