// An alternative approach: using a 'using type alias'. C++11 #include int x = 5; templatedouble f(){ using it = typename T::iterator; // a 'using type alias' it *x; // A simpel and plain declaration: x is of type it* // ... } int main(){ f>(); // >> is OK in C++11 }