4.6.0
Freundlich's C++ toolkit
|
A generic struct that identifies elements by types.
A record of an MPL sequence fcppt::record::element element<L_1,T_1>,...,element<L_n,T_n>
contains an object of type T_i
, accessible by L_i
, for every i = 1,...,n
.
Elements | Each one must be of type fcppt::record::element. |
Public Types | |
using | all_types = fcppt::mpl::list::object<Elements...> |
using | this_type = fcppt::record::object<Elements...> |
using | tuple |
The fcppt::tuple::object type (T_1,...,T_n) . | |
Public Member Functions | |
object () | |
Constructor for empty records. | |
object (fcppt::no_init const &) | |
An uninitialized record. | |
template<typename... Args> requires (fcppt::record::is_vararg_ctor<Args...>::value) | |
object (Args &&..._args) | |
Generic constructor. | |
template<typename Label > | |
void | set (fcppt::record::label_value_type< this_type, Label > const &) |
Sets an element by copy. | |
template<typename Label > | |
void | set (fcppt::record::label_value_type< this_type, Label > &&) |
Sets an element by move. | |
template<typename Label > | |
fcppt::record::label_value_type< this_type, Label > const & | get () const |
Gets an element. | |
template<typename Label > | |
fcppt::record::label_value_type< this_type, Label > & | get () |
Gets an element. | |
tuple & | impl () |
tuple const & | impl () const |
using fcppt::record::object< Elements >::all_types = fcppt::mpl::list::object<Elements...> |
using fcppt::record::object< Elements >::this_type = fcppt::record::object<Elements...> |
using fcppt::record::object< Elements >::tuple |
The fcppt::tuple::object type (T_1,...,T_n)
.
fcppt::record::object< Elements >::object | ( | ) |
Constructor for empty records.
Calling this if Elements is not empty, a compile-time error occurs.
|
explicit |
An uninitialized record.
Calls only default constructors for its elements. Use this with care.
|
explicit |
Generic constructor.
Initializing an element<L_i,T_i>
is done by calling L_i{} = v_i
where v_i
is of type T_i
.
The constructor checks that each L_i
appears exactly once in Args.
_args | A parameter pack, obtained by assignment to fcppt::record::label. |
Args | Implementation-defined init types, obtained by assignment to fcppt::record::label. |
|
nodiscard |
Gets an element.
|
nodiscard |
Gets an element.
|
nodiscard |
|
nodiscard |
void fcppt::record::object< Elements >::set | ( | fcppt::record::label_value_type< this_type, Label > && | ) |
Sets an element by move.
void fcppt::record::object< Elements >::set | ( | fcppt::record::label_value_type< this_type, Label > const & | ) |
Sets an element by copy.