I want to specialize a template for STL's vector template arguments. Something like this:
// (1)
template <typename T>
class A
{
...
};
// (2)
template <>
class A<std::vector<> >
{
...
};
I don't care what is the type of the vector element. I would like to use it as follows:
A<int> a1; // Will use the general specialization
A<std::vector<int> > a2; // Will use the second specialization
In general I've been trying to define something similar to boost's type traits. Something like
template <class T>
struct is_stl_vector
{
// Will be true if T is a vector, false otherwise
static const bool value = ...;
};
I cannot use template template (I think so) because it should compile for non-template types too. Is it possible at all?