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

@ -23,7 +23,7 @@
* template <>
* struct fmt::formatter<Foo> : EnumFormatter<Foo::C>
* {
* formatter() : EnumFormatter({"A", "B", "C"}) {}
* constexpr formatter() : EnumFormatter({"A", "B", "C"}) {}
* };
*
* enum class Bar
@ -39,7 +39,7 @@
* // using std::array here fails due to nullptr not being const char*, at least in MSVC
* // (but only when a field is used; directly in the constructor is OK)
* static constexpr array_type names = {"D", "E", nullptr, "F"};
* formatter() : EnumFormatter(names) {}
* constexpr formatter() : EnumFormatter(names) {}
* };
*/
template <auto last_member, typename = decltype(last_member)>