"Paul Mensonides" <[EMAIL PROTECTED]> writes:

> ----- Original Message -----
> From: "David Abrahams" <[EMAIL PROTECTED]>
>
>> > 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.
>
> Cool, I learn something every day.  I assume, though, that if I attempted to
> actually use the second parameter it would become non-deducable, right?

No, as long as identity<T>::type* matches the type of the parameter
you pass, everything still works.

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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to