Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-12 19:21:29


"Paul Mensonides" <pmenso57_at_[hidden]> writes:

> I didn't know that this was legal:
>
> template<class T> struct identity {
> typedef T type;
> };
>
> template<class T> void func(const T&, typename identity<T>::type* = 0);
>
> int main() {
> func(10);
> return 0;
> }

Sure, T is deducible due to the first argument.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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