summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2015-09-30 12:01:39 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2015-09-30 12:01:39 +0200
commit3ee27804a62e7d0c67341afbcbe2f1a90b93c9c6 (patch)
tree65abf32c3b7d82c2abb062e2dcfc92e300b2993c
parentf006c1ea01b37173dbfc893266a541fe1f4e3524 (diff)
downloadmanager-3ee27804a62e7d0c67341afbcbe2f1a90b93c9c6.tar.gz
manager-3ee27804a62e7d0c67341afbcbe2f1a90b93c9c6.zip
Add CRSMConfigValue-specialization for enums using std::is_enum and
std::underlying_type
-rw-r--r--src/CRSMConfig.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/CRSMConfig.hpp b/src/CRSMConfig.hpp
index c0f3b06..c161b68 100644
--- a/src/CRSMConfig.hpp
+++ b/src/CRSMConfig.hpp
@@ -191,6 +191,13 @@ public:
};
template<typename Type>
+class CRSMConfigValue<Type, typename std::enable_if<std::is_enum<Type>::value>::type> : CRSMConfigValue<typename std::underlying_type<Type>::type> {
+ using UndType = typename std::underlying_type<Type>::type;
+public:
+ CRSMConfigValue(Type& config) : CRSMConfigValue<UndType>::CRSMConfigValue(static_cast<UndType&>(config)) {}
+};
+
+template<typename Type>
CRSMConfigValue<Type>* mkConfigValue(Type& Value)
{
return new CRSMConfigValue<Type>(Value);