diff --git a/deps/fmt/include/fmt/format.h b/deps/fmt/include/fmt/format.h index 68231392..b5de6e00 100644 --- a/deps/fmt/include/fmt/format.h +++ b/deps/fmt/include/fmt/format.h @@ -3352,6 +3352,20 @@ template <> struct formatter { detail::dynamic_format_specs specs_; }; +/** + \rst + Converts ``e`` to the underlying type. + **Example**:: + enum class color { red, green, blue }; + auto s = fmt::format("{}", fmt::underlying(color::red)); + \endrst + */ +template +constexpr auto underlying(Enum e) noexcept -> + typename std::underlying_type::type { + return static_cast::type>(e); +} + template struct arg_join : detail::view { It begin;