Spec-Zone.ru › C++

std::meta::is_enumerator

Defined in header <meta>
consteval bool is_enumerator( std::meta::info r );
(since C++26)

Returns true if r represents an enumerator. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents an enumerator; otherwise false.

Example

#include <meta>

enum E { e };

static_assert( std::meta::is_enumerator(^^e));
static_assert(!std::meta::is_enumerator(^^E));
static_assert( std::meta::is_enum_type(^^E));

int main() {}

See also

is_enum
(C++11)
checks if a type is an enumeration type
(class template)
is_scoped_enum
(C++23)
checks if a type is a scoped enumeration type
(class template)
is_enum_type
(C++26)
checks if reflected type is an enumeration type
(function)
is_scoped_enum_type
(C++26)
checks if reflection represents a scoped enumeration type
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_enumerator

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API