Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-05-13 03:17:49


"David Abrahams" <dave_at_[hidden]> wrote in message
news:7ji352i1.fsf_at_boost-consulting.com...
| "Thorsten Ottosen" <nesotto_at_[hidden]> 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.

right. It's pretty obvious for me now.

Thanks for the explanations.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk