attribute reflection allows to enumerate and direct access to the attributes of a class. A class supports reflection if the following typedef and two methods are implemented:
More...
#include <reflection.h>
template<typename T>
{
typename std::decay_t<T>::attribute_tuple_t;
{ t.attribute_tuple() };
{ std::as_const(t).attribute_tuple() };
}
attribute reflection allows to enumerate and direct access to the attributes of a class....
Definition: reflection.h:34
attribute reflection allows to enumerate and direct access to the attributes of a class. A class supports reflection if the following typedef and two methods are implemented:
- typename attribute_tuple_t : a named<tuple> of the types of the attributes (for a non-const struct)
- named<std::tuple<...>, ...> attribute_tuple(void) : returns a named<tuple> of references to the attributes
- named<std::tuple<...>, ...> attribute_tuple(void) const : returns a named<tuple> of const references to the attributes