refactor list of const static int into scoped enum

This commit is contained in:
Dennis Luxen
2014-05-08 18:04:05 +02:00
parent b0ead129ca
commit f060dfda40
12 changed files with 846 additions and 941 deletions
+8
View File
@@ -72,6 +72,14 @@ template <int length, int precision> static inline char *printInt(char *buffer,
return buffer;
}
// convert scoped enums to integers
template <typename Enumeration>
auto as_integer(Enumeration const value)
-> typename std::underlying_type<Enumeration>::type
{
return static_cast<typename std::underlying_type<Enumeration>::type>(value);
}
static inline void intToString(const int value, std::string &output)
{
output.clear();