diff --git a/include/fc/io/enum_type.hpp b/include/fc/io/enum_type.hpp index f6c737a..d731c6d 100644 --- a/include/fc/io/enum_type.hpp +++ b/include/fc/io/enum_type.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include namespace fc @@ -26,28 +27,18 @@ namespace fc EnumType value; }; - /** reflects like an enum */ + template - struct reflector< enum_type > + void to_variant( const enum_type& var, variant& vo ) { - typedef EnumType type; - typedef fc::true_type is_defined; - typedef fc::true_type is_enum; - - template - static inline void visit( const Visitor& v ) - { - reflector::visit(v); - } - static const char* to_string(int64_t i) - { - return reflector::to_string(i); - } - static EnumType from_string(const char* s) - { - return reflector::from_string(s); - } - }; + vo = var.value; + } + template + void from_variant( const variant& var, enum_type& vo ) + { + vo.value = var.as(); + } + /** serializes like an IntType */ namespace raw