is_array Class

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

Tests if type is array.

template <class Ty>  
struct is_array;  

Parameters

Ty
The type to query.

An instance of the type predicate holds true if the type Ty is an array type, otherwise it holds false.

// std_tr1__type_traits__is_array.cpp   
// compile with: /EHsc   
#include <type_traits>   
#include <iostream>   
  
struct trivial   
    {   
    int val;   
    };   
  
int main()   
    {   
    std::cout << "is_array<trivial> == " << std::boolalpha   
        << std::is_array<trivial>::value << std::endl;   
    std::cout << "is_array<int> == " << std::boolalpha   
        << std::is_array<int>::value << std::endl;   
    std::cout << "is_array<int[5]> == " << std::boolalpha   
        << std::is_array<int[5]>::value << std::endl;   
  
    return (0);   
    }  
  

is_array<trivial> == false  
is_array<int> == false  
is_array<int[5]> == true  

Header: <type_traits>

Namespace: std

<type_traits>
extent Class
rank Class

Show: