SHARE
TWEET

Untitled

a guest Jun 27th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top