Spec-Zone.ru › C++

std::is_reflection

Defined in header <type_traits>
template< class T >
struct is_reflection;
(since C++26)

std::is_reflection is a UnaryTypeTrait.

Checks whether T is the type std::meta::info.

Provides the member constant value that is equal to true, if T is the type std::meta::info, conststd::meta::info, volatilestd::meta::info, or constvolatilestd::meta::info.

Otherwise, value is equal to false.

If the program adds specializations for std::is_reflection or std::is_reflection_v, the behavior is undefined.

Template parameters

T - a type to check

Helper variable template

template< class T >
constexpr bool is_reflection_v = is_reflection<T>::value;
(since C++26)

Inherited from std::integral_constant

Member constants

value
[static]
true if T is the type std::meta::info (possibly cv-qualified), false otherwise
(public static member constant)

Member functions

operator bool
converts the object to bool, returns value
(public member function)
operator()
(C++14)
returns value
(public member function)

Member types

Type Definition
value_type bool
type std::integral_constant<bool,value>

Possible implementation

template<class T>
struct is_reflection : std::is_same<std::meta::info, std::remove_cv_t<T>> {};

Example

#include <meta>
#include <type_traits>

static_assert(std::is_reflection_v<decltype(^^::)>);
static_assert(std::is_reflection_v<std::add_cv_t<std::meta::info>>);

int main() {}

See also

is_void
(C++11)
checks if a type is void
(class template)
is_array
(C++11)
checks if a type is an array type
(class template)
is_pointer
(C++11)
checks if a type is a pointer type
(class template)
is_enum
(C++11)
checks if a type is an enumeration type
(class template)
is_union
(C++11)
checks if a type is a union type
(class template)
is_class
(C++11)
checks if a type is a non-union class type
(class template)
is_function
(C++11)
checks if a type is a function type
(class template)
is_object
(C++11)
checks if a type is an object type
(class template)
is_reflection_type
(C++26)
checks if reflected type is std::meta::info
(function)

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

Spec-Zone.ru

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