title: Overloading operator new for a class
body: <p>When we overload new operator of a class, we declare the function as a member function.
  For eg:</p>
  
  <pre><code>class OpNew {
  public:
      OpNew() { cout &lt;&lt; "OpNew::OpNew()" &lt;&lt; endl;}
      void* operator new(size_t sz) {
           cout &lt;&lt; "OpNew::new: "
              &lt;&lt; sz &lt;&lt; " bytes" &lt;&lt; endl;
           return ::new char[sz];
      }
  };
  </code></pre>
  
  <p>How does the statement <code>OpNew *obj = new OpNew</code> work under the hood ? as overloaded new is a member of OpNew class not a static. So how does compiler ensure this call to <code>new</code> member  function succeeds? </p>