Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. class Thing {
  2. public:
  3. int m_Integer = 0;
  4.  
  5. Thing() {
  6. std::cout << "Thing constructor has been called! Address: " << this << ".n ";
  7. }
  8.  
  9. ~Thing() noexcept {
  10. std::cout << "Thing destructor has been called! Address: " << this << ".n";
  11. }
  12.  
  13. static Thing CreateInstance() {
  14. return Thing();
  15. }
  16.  
  17. void* GetThis() {
  18. return this;
  19. }
  20. };
  21.  
  22. void* hThing = Thing::CreateInstance().GetThis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement