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

PrevUpHomeNext

Function template structure_to_tuple

boost::pfr::structure_to_tuple — Creates a std::tuple from fields of an simple aggregate val.

Synopsis

// In header: <boost/pfr/core.hpp>


template<typename T> constexpr auto structure_to_tuple(const T & val);

Description

Example:

struct my_struct { int i, short s; };
my_struct s {10, 11};
std::tuple<int, short> t = boost::pfr::structure_to_tuple(s);
assert(get<0>(t) == 10);


PrevUpHomeNext