Avoid a gcc warning in enum option_to_string impl

This commit is contained in:
Maxime Coste 2016-02-29 20:15:23 +00:00
parent b0e12f2bcb
commit 92b56cbda0

View File

@ -43,8 +43,10 @@ EnableIfWithoutBitOps<Enum, String> option_to_string(Enum e)
{ {
constexpr auto desc = enum_desc(Enum{}); constexpr auto desc = enum_desc(Enum{});
auto it = find_if(desc, [e](const EnumDesc<Enum>& d) { return d.value == e; }); auto it = find_if(desc, [e](const EnumDesc<Enum>& d) { return d.value == e; });
kak_assert(it != desc.end()); if (it != desc.end())
return it->name.str(); return it->name.str();
kak_assert(false);
return {};
} }
template<typename Flags, typename = decltype(enum_desc(Flags{}))> template<typename Flags, typename = decltype(enum_desc(Flags{}))>