This is a sip, so here is a sample code:
template<typename T>
void foo(const T& a, typename T::value_type::value_type b) { }
std::vector<std::vector<int>> vec;
foo(vec, 4);
It compiles and runs correctly using gcc. It does not compile using Visual Studio 2010 for the reason described above. However, if the final one value_typehas a prefix with a keyword template, it will compile and run correctly. I have a few guesses about why, but I canβt find the corresponding section of the standard.
template<typename T>
void foo(const T& a, typename T::value_type::template value_type b) { }
std::vector<std::vector<int>> vec;
foo(vec, 4);
I know that the above use templateis a Visual Studio extension, but what does the standard say about using these types? Is gcc code adoption also an extension, or is it a flaw in the Visual Studio part?