[#fmt-underlying] = xref:fmt.adoc[fmt]::underlying :relfileprefix: ../ :mrdocs: Converts `e` to the underlying type. == Synopsis Declared in `<fmt/format.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Enum> constexpr xref:fmt/underlying_t.adoc[underlying_t<Enum>] underlying(Enum e) noexcept; ---- == Description *Example*: enum class color { red, green, blue }; auto s = fmt::format("{}", fmt::underlying(color::red)); // s == "0" [.small]#Created with https://www.mrdocs.com[MrDocs]#