![]() |
Home | Libraries | People | FAQ | More |
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> decltype(auto) constexpr get(const T & val); template<std::size_t I, typename T> decltype(auto) constexpr get(T & val, std::enable_if_t< std::is_assignable< T, T >::value > * = nullptr); template<std::size_t I, typename T> constexpr auto get(T &, std::enable_if_t<!std::is_assignable< T, T >::value > * = nullptr); template<std::size_t I, typename T> constexpr auto get(T && val, std::enable_if_t< std::is_rvalue_reference< T && >::value > * = nullptr); template<typename U, typename T> constexpr const U & get(const T & val); template<typename U, typename T> constexpr U & get(T & val, std::enable_if_t< std::is_assignable< T, T >::value > * = nullptr); template<typename U, typename T> constexpr U & get(T &, std::enable_if_t<!std::is_assignable< T, T >::value > * = nullptr); template<typename U, typename T> constexpr U && get(T && val, std::enable_if_t< std::is_rvalue_reference< T && >::value > * = nullptr);