template class C {}; template class iterator { public: typedef T value; typedef T& reference; }; template class cont { public: typedef iterator iter; typename iter::reference at() { #ifndef __CINT__ static typename iter::value t; #endif return t; } //typename iter::reference& at2(); }; cont > c;