It is my understanding that the C++ standard supports templated template parameters, where a template parameter itself is templated. Recently, I recompiled some old code after upgrading to a higher version of g++. It was complaining about a templated function where the template parameter was templated. Since this code had always worked before, and has been working fine for the past couple of years, I was confused why this new version of g++ was having a problem with it. So, I came up with a very simplified test case, shown below. This new version of g++ (4.3.2) will not compile the code below, and yet as far as I can see it's perfectly legitimate and works fine when compiled using g++ 4.1.2.
On the other hand, lately newer versions of g++ have only been getting more strict when it comes to the standard, so I wonder if I am misunderstanding the use of templated template parameters, and the code below is in fact not legal for some reason.
So, my question is, is the code below legal or is this new version of g++ incorrect? And if g++ is correct about this, how can I fix the code below?
template <template <class> class Array>
void dosomething(const Array<std::string>& array)