title: Memory Leak Detecting and overriding new?
body: <p>I am attempting to get Memory leak detection working with the help of these two articles:
  <a href="http://msdn.microsoft.com/en-us/library/e5ewb1h3%28VS.80%29.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/e5ewb1h3%28VS.80%29.aspx</a>
  <a href="http://support.microsoft.com/kb/q140858/" rel="noreferrer">http://support.microsoft.com/kb/q140858/</a></p>
  
  <p>So in my stdafx.h I now have:</p>
  
  <pre><code>#define _CRTDBG_MAP_ALLOC
  #include &lt;stdlib.h&gt;
  #include &lt;crtdbg.h&gt;
  
  #define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
  </code></pre>
  
  <p>The only problem is, I have a class which overrides the new function:</p>
  
  <pre><code>class Dummy
  {    
    //overloaded new operator
    void FAR* operator new(size_t cb);
  }
  </code></pre>
  
  <p>Now when I compile this code, I get:
  error C2059: syntax error : 'constant'
  error C2091: function returns function</p>
  
  <p>Any idea how I can fix this?</p>