I just started in C ++, so sorry if this is a newbie question. I searched the net and found nothing about it. In fact, I was not even sure how to formulate my search ...
I saw this code somewhere:
template <class T>
struct SomeStruct
{
SomeStruct() {}
};
And later, this:
int main()
{
SomeStruct<void (Foo::*)(int test)> mStruct;
}
Compiled above.
So, if I understood correctly, "void (Foo :: *) (int test)" is a pointer to a function that points to some function in Foo that takes an int as an argument and returns void.
How can this be a legal argument for the parameter "class T"?
Any help would be appreciated.
source
share