| View previous topic :: View next topic |
| Author |
Message |
nonchai Guest
|
Posted: Wed Nov 22, 2006 7:45 am Post subject: Can anyone explain what the argument in: __test_type(int _Tp |
|
|
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
|
Posted: Wed Nov 22, 2006 9:10 am Post subject: Re: Can anyone explain what the argument in: __test_type(int |
|
|
| 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 |
|
 |
|