15

Similar to what __FUNCTION__ does for the current function, Is there a preprocessor macro to get the name of the current class?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Damian
  • 5,471
  • 11
  • 56
  • 89

1 Answers1

2

No, there is no such macro - sorry.

But nevertheless: __FUNCTION__ (or __PRETTY_FUNCTION__ with gcc) should give you the name of the enclosing class - you just have to extract it.

Alexander Gessler
  • 45,603
  • 7
  • 82
  • 122