How to use operator new to count number of times of dynamic memory allocation
<p>Given the following code:</p>

<pre><code>int i;
...
ostingstream os;
os&lt;&lt;i;
string s=os.str();
</code></pre>

<p>I want to count the number of times of dynamic memory allocation when using <code>ostringstream</code> this way. How can I do that? Maybe through <code>operator new</code>?</p>

<p>Thank you.</p>
