std::meta::is_array_type - cppreference.com
Namespaces
Variants

std::meta::is_array_type

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