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

◆ operator auto()

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

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

Returns
One of xtd::enum_attribute values.
Remarks
To set attribute to an enumeration just override xtd::enum_set_attribute.
Examples
The following code show how to set attribute to the value_flags enum class.
enum class value_flags {
value_none = 0,
value_one = 0b1,
value_two = 0b10,
value_three = 0b100,
};
template<>
explicit operator auto() const noexcept {return xtd::enum_attribute::flags;}
};
@ flags
Enum flags attribute.
Provides the set attribute struct for enumerations.
Definition enum_set_attribute.h:31