Advertisement
Guest User

Untitled

a guest
May 24th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. [sas@iPhone-65 ~] cat test.cpp
  2. #include "test2.h"
  3. #include <cstdio>
  4.  
  5. Foo f;
  6. Bar b;
  7.  
  8. void doStuff() {
  9. printf("%s\n", __PRETTY_FUNCTION__);
  10.  
  11. static Foo localF;
  12. static Bar localB;
  13.  
  14. printf("%s\n", __PRETTY_FUNCTION__);
  15. }
  16.  
  17. int main() {
  18. doStuff();
  19. }
  20. [sas@iPhone-65 ~] cat test2.cpp
  21. #include "test2.h"
  22.  
  23. #include <cstdio>
  24.  
  25. #define F(NAME) NAME() { printf("%p: %s\n", this, __PRETTY_FUNCTION__); }
  26.  
  27. F(Foo::Foo)
  28. F(Foo::~Foo)
  29. F(Bar::Bar)
  30. F(Bar::~Bar)
  31. [sas@iPhone-65 ~] cat test2.h
  32. #ifndef test2_h_
  33. #define test2_h_
  34.  
  35. class Foo {
  36. public:
  37. Foo();
  38. virtual ~Foo();
  39. };
  40.  
  41. class Bar : public Foo {
  42. public:
  43. Bar();
  44. virtual ~Bar();
  45. };
  46.  
  47. #endif
  48. [sas@iPhone-65 ~]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement