Namespaces
Variants

std::meta::is_enum_type

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and queries
Type properties
Type property queries
 
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

#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

checks if reflection represents an enumerator
(function) [edit]
checks if reflection represents a scoped enumeration type
(function) [edit]
checks if reflected type is a scalar type
(function) [edit]
checks if reflected type is an integral type
(function) [edit]
checks if reflection represents an arithmetic type
(function) [edit]
(C++11)
checks if a type is an enumeration type
(class template) [edit]
checks if a type is a scoped enumeration type
(class template) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.