| Illustration of a couple of ambiguities. | Lecture 5 - slide 28 : 39 Program 3 |
#include <vector>
int x = 5;
template<typename T>double f(){ // The name iterator depends on T.
T::iterator *x; // Ambiguity 1:
// T::iterator multiplied by x OR
// x declared as a pointer to the type named T::iterator
// ...
}
int main(){
f<std::vector<double>>(); // Ambiguity 2:
// >> shift right OR
// end of nested template argument list
}