Template Class SafeEnum

Inheritance Relationships

Base Type

  • public Def

Class Documentation

template<typename Def, typename Inner = typename Def::Type>
class SafeEnum : public Def

SafeEnum provides a wrapper for enumerated types in a typesafe manner.

SafeEnums allow specification of the underlying type, do not implictly convert to integers, and resolve scoping issues.

Public Functions

inline constexpr SafeEnum(Inner v)
inline Inner underlying() const
inline bool operator==(const SafeEnum &s) const
inline bool operator!=(const SafeEnum &s) const
inline bool operator<(const SafeEnum &s) const
inline bool operator<=(const SafeEnum &s) const
inline bool operator>(const SafeEnum &s) const
inline bool operator>=(const SafeEnum &s) const