[#fmt-underlying]
= xref:fmt.adoc[fmt]::underlying
:relfileprefix: ../
:mrdocs:

Converts `e` to the underlying type&period;

== Synopsis

Declared in `&lt;fmt&sol;format&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Enum&gt;
constexpr
xref:fmt/underlying_t.adoc[underlying&lowbar;t&lt;Enum&gt;]
underlying(Enum e) noexcept;
----

== Description

*Example*&colon;

enum class color &lcub; red, green, blue &rcub;&semi; auto s &equals; fmt&colon;&colon;format(&quot;&lcub;&rcub;&quot;, fmt&colon;&colon;underlying(color&colon;&colon;red))&semi; &sol;&sol; s &equals;&equals; &quot;0&quot;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
