Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2024. The current version is 1.91.0.
boost::pfr::get — Returns reference or const reference to a field with index I in simple aggregate val. Overload taking the type U returns reference or const reference to a field with provided type U in simple aggregate val if there's only one field of such type in val.
// In header: <boost/pfr/core.hpp> template<std::size_t I, typename T> BOOST_PFR_BEGIN_MODULE_EXPORT constexpr decltype(auto) get(const T & val);