C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can anyone explain what the argument in: __test_type(int _Tp

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
nonchai
Guest





PostPosted: Wed Nov 22, 2006 7:45 am    Post subject: Can anyone explain what the argument in: __test_type(int _Tp Reply with quote



Can anyone explain what the function argument in: __one __test_type(int
_Tp::*); means ?

Tp is a template place holder. It is in a function template. Here is
the
full code:

namespace __gnu_internal
{
typedef char __one;
typedef char __two[2];

template<typename _Tp>
__one __test_type(int _Tp::*);
template<typename _Tp>
__two& __test_type(...);

} // namespace __gnu_internal


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Ivan Novick
Guest





PostPosted: Wed Nov 22, 2006 9:10 am    Post subject: Re: Can anyone explain what the argument in: __test_type(int Reply with quote



Quote:
namespace __gnu_internal
{
typedef char __one;
typedef char __two[2];

template<typename _Tp
__one __test_type(int _Tp::*);
template<typename _Tp
__two& __test_type(...);

} // namespace __gnu_internal

There are 2 versions of the template member function __test_type.

I read it as the first will get instantiated if you pass in a member
function pointer of the _Tp class and the second will get instantiated
for any other template argument and takes a variable number of
parameters.

Ivan
-------------------------
http://www.0x4849.net


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.