xtd 0.2.0
Loading...
Searching...
No Matches

◆ operator auto()

template<typename enum_t >
xtd::enum_register< enum_t >::operator auto ( ) const
inlineexplicitnoexcept

Allows to register an enumeration that can be used by xtd::enum_object.

Returns
An xtd::enum_collection collection that represent enumeration.
Remarks
To register an enumeration just override xtd::enum_register.
Examples
The following code show how to register the values enum class.
enum class values {
value_one,
value_two
};
template<>
explicit operator auto() const noexcept {return xtd::enum_collection<values> {{values::value_one, "value_one"}, {values::value_two, "value_two"}};}
};
std::vector< xtd::collections::generic::key_value_pair< enum_t, xtd::string > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition enum_collection.h:22
Provides the registration struct for enumerations.
Definition enum_register.h:38