2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00
This commit is contained in:
denzor200
2023-09-10 01:22:14 +03:00
parent dd8a5277fb
commit 8794056e20
21 changed files with 192 additions and 55 deletions

View File

@@ -10,7 +10,7 @@
#include <boost/pfr/config.hpp>
#if BOOST_PFR_ENABLE_GET_NAME_STATIC && BOOST_PFR_USE_CPP17
#if BOOST_PFR_CORE_NAME_ENABLED && BOOST_PFR_USE_CPP17
//[pfr_example_get_name
/*`
Since C++20 it's possible to read name of structure fields by index using Boost.PFR library.
@@ -34,7 +34,7 @@ constexpr auto r2 = boost::pfr::get_name<1, foo>(); // reading name of field wit
#endif
int main() {
#if BOOST_PFR_ENABLE_GET_NAME_STATIC && BOOST_PFR_USE_CPP17
#if BOOST_PFR_CORE_NAME_ENABLED && BOOST_PFR_USE_CPP17
if (r1 != "some_integer") return 1;
if (r2 != "c") return 2;
#endif