Merged revision(s) 83914 from trunk:

Fix new double(n) to new double[n].

[SVN r83915]
This commit is contained in:
Peter Dimov
2013-04-15 15:13:20 +00:00
parent 240c66e633
commit 9355404d10

View File

@@ -61,8 +61,8 @@ shared_ptr<void> p2( new int(5) );
the template parameter. There is almost no difference between using an unsized array, <code>T[]</code>, the template parameter. There is almost no difference between using an unsized array, <code>T[]</code>,
and a sized array, <code>T[N]</code>; the latter just enables <code>operator[]</code> to perform a range check and a sized array, <code>T[N]</code>; the latter just enables <code>operator[]</code> to perform a range check
on the index.</p> on the index.</p>
<blockquote><em>Example:</em><br /><pre>shared_ptr&lt;double[1024]&gt; p1( new double(1024) ); <blockquote><em>Example:</em><br /><pre>shared_ptr&lt;double[1024]&gt; p1( new double[1024] );
shared_ptr&lt;double[]&gt; p2( new double(n) ); shared_ptr&lt;double[]&gt; p2( new double[n] );
</pre></blockquote> </pre></blockquote>
<h2 id="BestPractices">Best Practices</h2> <h2 id="BestPractices">Best Practices</h2>