Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: Default fun...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 7 Topic 45808 of 47032
Post > Topic >>

Re: Default function parameter values

by Andrey Tarasevich <andreytarasevich@[EMAIL PROTECTED] > May 8, 2008 at 05:20 PM

Victor Bazarov wrote:
> ...
> Set to 0 of what type?  '0' has the type 'int'.  It is convertible
> to any pointer type and to any pointer-to-member type, but the
> compiler needs to know what the destination type is.  It cannot
> know from the type from the expression you supplied, that's why it
> complains.
> ...

Strictly speaking, the compiler cannot deduce the type simply because 
default arguments do not participate in template argument deduction at 
all. The fact that integral constant '0' is convertible to many 
different pointer types plays no role here.

-- 
Best regards,
Andrey Tarasevich
 




 7 Posts in Topic:
Default function parameter values
Tim Frink <plfriko@[EM  2008-05-08 12:16:07 
Re: Default function parameter values
"Victor Bazarov"  2008-05-08 08:25:23 
Re: Default function parameter values
Andrey Tarasevich <and  2008-05-08 17:20:50 
Re: Default function parameter values
Tim Frink <plfriko@[EM  2008-05-08 13:10:36 
Re: Default function parameter values
"Victor Bazarov"  2008-05-08 10:00:16 
Re: Default function parameter values
Andrey Tarasevich <and  2008-05-08 17:32:08 
Re: Default function parameter values
Tim Frink <plfriko@[EM  2008-05-09 10:13:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 21:14:02 CDT 2008.