Since std::array<> and std::is_array<> were both introduced in C++11, it seems very strange that this fails to compile:
#include <array>
#include <type_traits>
static_assert(std::is_array<std::array<int,2>>::value);
Is there a simple way to check if something is an array, including both the possibilities of T[N]
and std::array<T,N>
?
Aucun commentaire:
Enregistrer un commentaire