Can static_assert check if a type is a vector?

Viewed 8359

Can static_assert check if a type is a vector? IE, an int would raise the assertion, whereas a vector<int> would not.
I'm thinking of something along the lines of:

static_assert(decltype(T) == std::vector, "Some error")
4 Answers
Related