...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::pfr::tie_from_structure — std::tie-like function that allows assigning to tied values from aggregates.
// In header: <boost/pfr/core.hpp> template<typename... Elements> unspecified tie_from_structure(Elements &... args);
Example:
auto f() { struct { struct { int x, y } p; short s; } res { { 4, 5 }, 6 }; return res; } auto [p, s] = f(); boost::pfr::tie_from_structure(p, s) = f();
Returns: |
an object with lvalue references to |