From d61e675caf0799268b8a7c1ad36b69e848c2e208 Mon Sep 17 00:00:00 2001
From: Peter Dimov
Date: Mon, 15 Apr 2013 15:11:29 +0000
Subject: [PATCH] Fix new double(n) to new double[n].
[SVN r83914]
---
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