Reputation: 558
I got this line into a macro definition of a class
virtual const char *GetEventName() const
{
return #classname;
}
What is happening in this function and its return type?
Upvotes: 1
Views: 118
Reputation: 31952
If classname
is one of the arguements of the macro, #classname
is a string version of its value. So if classname
were SomeType
, #classname
would be the equivalent of "SomeType"
Since it is returning a string (c string) the return type is const char*
For more information look at Stringification
Upvotes: 4