How to check if a type is a specialization of the std::array class template

You have to write your own, but it’s simple:

template<typename>
struct is_std_array : std::false_type {};

template<typename T, std::size_t N>
struct is_std_array<std::array<T,N>> : std::true_type {};

Leave a Comment