Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 1.38 KB

is-enum-class.md

File metadata and controls

73 lines (54 loc) · 1.38 KB
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: is_enum Class
is_enum Class
11/04/2016
type_traits/std::is_enum
is_enum class
is_enum
df3b00b7-4f98-4b3a-96ce-10ad958ee69c

is_enum Class

Tests if type is an enumeration.

Syntax

template <classTy> structis_enum;

Parameters

Ty
The type to query.

Remarks

An instance of the type predicate holds true if the type Ty is an enumeration type or a cv-qualified form of an enumeration type, otherwise it holds false.

Example

// std__type_traits__is_enum.cpp// compile with: /EHsc #include<type_traits> #include<iostream>structtrivial { int val; }; enum color { red, greed, blue}; intmain() { std::cout << "is_enum<trivial> == " << std::boolalpha << std::is_enum<trivial>::value << std::endl; std::cout << "is_enum<color> == " << std::boolalpha << std::is_enum<color>::value << std::endl; std::cout << "is_enum<int> == " << std::boolalpha << std::is_enum<int>::value << std::endl; return (0); }
is_enum<trivial> == false is_enum<color> == true is_enum<int> == false 

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
is_integral Class

close