From 9355404d1045462d5820fa659f28e6573a472e1a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 15 Apr 2013 15:13:20 +0000 Subject: [PATCH] Merged revision(s) 83914 from trunk: Fix new double(n) to new double[n]. [SVN r83915] --- shared_ptr.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared_ptr.htm b/shared_ptr.htm index c534dd7..6c0e999 100644 --- a/shared_ptr.htm +++ b/shared_ptr.htm @@ -61,8 +61,8 @@ shared_ptr<void> p2( new int(5) ); the template parameter. There is almost no difference between using an unsized array, T[], and a sized array, T[N]; the latter just enables operator[] to perform a range check on the index.

-
Example:
shared_ptr<double[1024]> p1( new double(1024) );
-shared_ptr<double[]> p2( new double(n) );
+		
Example:
shared_ptr<double[1024]> p1( new double[1024] );
+shared_ptr<double[]> p2( new double[n] );
 

Best Practices