std::meta::is_scoped_enum_type
Defined in header <meta> | ||
|---|---|---|
consteval bool is_scoped_enum_type( std::meta::info r ); | (since C++26) |
Returns true if r represents a scoped enumeration type. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents a scoped enumeration type; otherwise false.
Exceptions
Throws std::meta::exception if r does not represent a type or type alias.
Example
#include <meta>
static_assert(is_scoped_enum_type(^^int) == false);
class A {};
static_assert(is_scoped_enum_type(^^A) == false);
enum B { self_test = is_scoped_enum_type(^^B) };
static_assert(is_scoped_enum_type(^^B) == false);
static_assert(!self_test);
enum struct C { final, import, module };
static_assert(is_scoped_enum_type(^^C) == true);
enum class D : int { pre, post, override };
static_assert(is_scoped_enum_type(^^D) == true);
enum class E;
static_assert(is_scoped_enum_type(^^E) == true);
int main() {}
See also
|
(C++26) | checks if reflected type is an enumeration type (function) |
|
(C++26) | checks if reflection represents an enumerator (function) |
|
(C++23) | checks if a type is a scoped enumeration type (class template) |
|
(C++11) | checks if a type is an enumeration type (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_scoped_enum_type