std::meta::is_array_type
Defined in header <meta> | ||
|---|---|---|
consteval bool is_array_type( std::meta::info r ); | (since C++26) |
Returns true if r represents an array type. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents an array type; otherwise false.
Exceptions
Throws std::meta::exception if r does not represent a type or type alias.
Example
#include <array>
#include <meta>
class A {};
static_assert(is_array_type(^^A) == false);
static_assert(is_array_type(^^A[]) == true);
static_assert(is_array_type(^^A[3]) == true);
static_assert(is_array_type(^^float) == false);
static_assert(is_array_type(^^int) == false);
static_assert(is_array_type(^^int[]) == true);
static_assert(is_array_type(^^int[3]) == true);
static_assert(is_array_type(^^std::array<int, 3>) == false);
int main() {}
See also
|
(C++26) | checks if reflection represents an array type of known bound (function) |
|
(C++26) | checks if reflection represents an array type of unknown bound (function) |
|
(C++26) | obtains the number of dimensions of reflected array type (function) |
|
(C++26) | obtains the size of reflected array type along a specified dimension (function) |
|
(C++26) | removes one extent from reflected array type (function) |
|
(C++26) | removes all extents from reflected array type (function) |
|
(C++26) | checks if reflected type is a scalar type (function) |
|
(C++20) | checks if a type is an array type of known bound (class template) |
|
(C++20) | checks if a type is an array type of unknown bound (class template) |
|
(C++11) | obtains the number of dimensions of an array type (class template) |
|
(C++11) | obtains the size of an array type along a specified dimension (class template) |
|
(C++11) | removes one extent from the given array type (class template) |
|
(C++11) | removes all extents from the given array type (class template) |
|
(C++11) | checks if a type is an array type (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_array_type