19#ifndef BDSTYPESAFEENUM_H
20#define BDSTYPESAFEENUM_H
45template<
typename def,
typename inner =
typename def::type>
55 static std::map<BDSTypeSafeEnum<def,inner>,std::string>*
dictionary;
64 std::string ToString()
const {
Improve type-safety of native enum data type in C++.
friend bool operator!=(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering
friend bool operator==(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering
static std::map< BDSTypeSafeEnum< def, inner >, std::string > * dictionary
friend bool operator<=(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering
friend std::ostream & operator<<(std::ostream &out, const BDSTypeSafeEnum &a)
friend bool operator>(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering
friend bool operator>=(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering
type underlying() const
return underlying value (can be used in switch statement)
friend bool operator<(const BDSTypeSafeEnum &lhs, const BDSTypeSafeEnum &rhs)
operators for ordering