14

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,438
  • 68
  • 55
  • 126
Damian
  • 5,391
  • 10
  • 54
  • 87

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
  • 44,353
  • 6
  • 80
  • 121