Use template specialization instead of name concatenation so that reflection of enums works for enums that are inside another class or namespace.

This commit is contained in:
Twan van Laarhoven
2020-09-27 18:34:46 +02:00
parent e7490486c4
commit e14fe1f40e
4 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ void Writer::handle(const IndexMap<K,V>& m) {
#define REFLECT_ENUM_WRITER(Enum) \
template<> void Writer::handle<Enum>(const Enum& enum_) { \
EnumWriter writer(*this); \
reflect_ ## Enum(const_cast<Enum&>(enum_), writer); \
ReflectEnum<Enum>::reflect(const_cast<Enum&>(enum_), writer); \
}
/// Handler to be used when reflecting enumerations for Writer