I\'ve got this sample code:
struct A
{
int foo() { return 27; }
};
template
struct Gobstopper
{
};
template<>
struct Gobstopper
-
You are quite correct.
The type of Signature
with a Win32 target is int __thiscall(void)
while on x64 it is int __cdecl(void)
. Note that on either target the type of non-member functions commonly called int(void)
is indeed int __cdecl(void)
so, by coincidence one of the constructed types actually (not really correctly!) matches.
In general it is not advisable to mix the different types of function pointers by template magic, so the Gobstopper specialization should look at something like int (ClassType::*)()
instead.
讨论(0)
- 热议问题