diff options
Diffstat (limited to 'src/common/Utilities/StringFormat.h')
-rw-r--r-- | src/common/Utilities/StringFormat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/Utilities/StringFormat.h b/src/common/Utilities/StringFormat.h index 3ec91494ef2..6f5e9a643bd 100644 --- a/src/common/Utilities/StringFormat.h +++ b/src/common/Utilities/StringFormat.h @@ -122,4 +122,8 @@ struct fmt::formatter<Optional<T>, Char> : formatter<T, Char> } }; +// allow implicit enum to int conversions for formatting +template <typename E, std::enable_if_t<std::is_enum_v<E>, std::nullptr_t> = nullptr> +auto format_as(E e) { return std::underlying_type_t<E>(e); } + #endif |