Make all fmt::formatter constructors constexpr

This commit is contained in:
Pokechu22
2022-01-12 17:28:17 -08:00
parent 78e43a4404
commit ac46b91673
9 changed files with 66 additions and 65 deletions

View File

@ -16,7 +16,7 @@ enum class Enum1 : u32
template <>
struct fmt::formatter<Enum1> : EnumFormatter<Enum1::C>
{
formatter() : EnumFormatter({"A", "B", "C"}) {}
constexpr formatter() : EnumFormatter({"A", "B", "C"}) {}
};
enum class Enum2 : s32
@ -30,7 +30,7 @@ template <>
struct fmt::formatter<Enum2> : EnumFormatter<Enum2::F>
{
static constexpr array_type names = {"D", "E", nullptr, "F"};
formatter() : EnumFormatter(names) {}
constexpr formatter() : EnumFormatter(names) {}
};
TEST(EnumUtil, Enum1)