Skip to content

Commit

Permalink
Small code tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
mawww committed May 24, 2017
1 parent 119a5b8 commit 074666d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/option_types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ template<typename Enum>
typename std::enable_if<std::is_enum<Enum>::value, String>::type
option_type_name(Meta::Type<Enum>)
{
constexpr StringView type = with_bit_ops(Meta::Type<Enum>{}) ? "flags" : "enum";
auto name = enum_desc(Meta::Type<Enum>{});
return type + "(" + join(name | transform(std::mem_fn(&EnumDesc<Enum>::name)), '|') + ")";
return format("{}({})", with_bit_ops(Meta::Type<Enum>{}) ? "flags" : "enum",
join(enum_desc(Meta::Type<Enum>{}) |
transform(std::mem_fn(&EnumDesc<Enum>::name)), '|'));
}

inline String option_to_string(int opt) { return to_string(opt); }
Expand Down

0 comments on commit 074666d

Please sign in to comment.