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 5 of 7 Topic 45808 of 46738
Post > Topic >>

Re: Default function parameter values

by "Victor Bazarov" <v.Abazarov@[EMAIL PROTECTED] > May 8, 2008 at 10:00 AM

Tim Frink wrote:
>> Because the compiler needs to know what 'T' is.  It cannot deduce
>> the type from an integral expression ('0').  You need to tell it
>> what the type T is by supplying the template argument, like
>>
>>     objectA.foo<sometype>(string("test"));
>
> But why can I invoke the function with:
>
> objectA.foo( string( "test" ), objectA, &A::funcPtr );
>
> where I do not specify the type of T either?
> Where does the compiler get to information what type T is?

Sure.  'objectA' has a particular type.  '&A::funcPtr' has it too.

V
-- 
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 




 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 Wed Jul 9 0:20:01 CDT 2008.