std::underlying_type

From cppreference.com
Jump to: navigation, search
Defined in header <type_traits>
template< class T >
struct underlying_type;
(since C++11)

Defines a member typedef type of type that is the underlying type for the enumeration T.

[edit] Member types

Name Definition
type the underlying type for T

[edit] Notes

Each enumeration type has an underlying type, which can be

1. Specified explicitly (both scoped and unscoped enumerations)

2. Omitted, in which case it is int for scoped enumerations or an implementation-defined integral type capable of representing all values of the enum (for unscoped enumerations)

[edit] Example

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox