SampleClass::CertainMethod
is the name of a function.
The name of a function implicitly decays into a pointer to the function in many use contexts.
Suppose you had:
void foo( void(*)() )
which is a function foo
that takes a pointer to a function. Then
foo( SampleClass::CertainMethod )
would pass a pointer to SampleClass::CertainMethod
to foo
to do with it what it will.
SampleClass::CertainMethod
cannot invoke the function, because then you could not talk about a pointer to it!
In your case, you are naming the function, then discarding it. You are allowed to do this in C++ -- you can have a statement like this:
int a = 3, b = 5;
a+b;
that a+b
adds a
to b
, then discards the result. Expressions are legal statements.
This is also legal:
a;
which is a simple expression that evaluates to 3
, but does nothing with the value.
So your line was an expression that evaluated a pointer or reference to SampleClass::CertainMethod
. Warning-worthy, but still legal C++.