Consider:

foo(n) will compile, but foo2(n) will not compile.Code:template<typename T> struct bar { typedef T type; }; template<typename T> void foo(T& t_) {} template<typename T> void foo2(typename bar<T>::type t_) {} int main() { int n; foo(n); foo2(n); }

I'm a little fuzzy on these rules. Why is it so, and what can be done about it?