
"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
| You can try it with | | template<class T> void begin( MyType<T> & t ); | | and see that it will fail in a similar way. Also try | | template<class T> void begin( T & t ); | | to see that it will succeed and deduce T as MyType<int> const. | | HTH.
hm..you learn something new every day; I wasn't aware of the difference between T& and UDT<T>&
It's not really a difference. With template <class T> void f(T&); T can be deduced as anything, including const U for some U. With template <class T> void f(something<T>&); again T can be deduced as anything, including const U for some U. But there's no leeway to magically insert a const after "something<T>", where there's no type parameter. -- Dave Abrahams Boost Consulting www.boost-consulting.com