std::meta::is_enum_type
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_enum_type( std::meta::info r );
|
(since C++26) | |
Returns true if r represents an enumeration type. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents an enumeration type; otherwise false.
Exceptions
Throws std::meta::exception if r does not represent a type or type alias.
Example
Run this code
#include <meta>
enum A { e };
enum class B { e };
static_assert(is_enum_type(^^A));
static_assert(is_enum_type(^^B));
static_assert(is_enumerator(^^e));
static_assert(is_enumerator(^^B::e));
static_assert(is_scalar_type(^^B));
static_assert(!is_integral_type(^^B));
static_assert(!is_arithmetic_type(^^B));
int main() {}
See also
(C++26) |
checks if reflection represents an enumerator (function) |
(C++26) |
checks if reflection represents a scoped enumeration type (function) |
(C++26) |
checks if reflected type is a scalar type (function) |
(C++26) |
checks if reflected type is an integral type (function) |
(C++26) |
checks if reflection represents an arithmetic type (function) |
(C++11) |
checks if a type is an enumeration type (class template) |
(C++23) |
checks if a type is a scoped enumeration type (class template) |