Small code tweak

This commit is contained in:
Maxime Coste 2017-05-24 15:40:16 +01:00
parent 119a5b8442
commit 074666d298

View File

@ -27,9 +27,9 @@ template<typename Enum>
typename std::enable_if<std::is_enum<Enum>::value, String>::type typename std::enable_if<std::is_enum<Enum>::value, String>::type
option_type_name(Meta::Type<Enum>) option_type_name(Meta::Type<Enum>)
{ {
constexpr StringView type = with_bit_ops(Meta::Type<Enum>{}) ? "flags" : "enum"; return format("{}({})", with_bit_ops(Meta::Type<Enum>{}) ? "flags" : "enum",
auto name = enum_desc(Meta::Type<Enum>{}); join(enum_desc(Meta::Type<Enum>{}) |
return type + "(" + join(name | transform(std::mem_fn(&EnumDesc<Enum>::name)), '|') + ")"; transform(std::mem_fn(&EnumDesc<Enum>::name)), '|'));
} }
inline String option_to_string(int opt) { return to_string(opt); } inline String option_to_string(int opt) { return to_string(opt); }