to_underlying#

Fully qualified name: carb::cpp::to_underlying

Defined in carb/cpp/Utility.h

template<typename Enum>
constexpr std::underlying_type_t<Enum> carb::cpp::to_underlying(
Enum e,
) noexcept#

Converts an enumeration to its underlying type.

Equivalent to return static_cast<std::underlying_type_t<Enum>>(e); Can be used to avoid converting an enumeration to an integer type other than its underlying type.

Parameters:

e – Enumeration value to convert.

Returns:

The integer value of the underlying type of Enum, converted from e.