From 550045e50345213cda46bc281d8623f3aa47d8ac Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@dune-project.org> Date: Wed, 14 Oct 2009 14:58:39 +0000 Subject: [PATCH] Follow the stl standard: the default constructor of a shared_ptr creates a NULL pointer, and does NOT allocate memory [[Imported from SVN: r5654]] --- dune/common/shared_ptr.hh | 2 +- dune/common/test/smartpointertest.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dune/common/shared_ptr.hh b/dune/common/shared_ptr.hh index a416976b2..62854abc9 100644 --- a/dune/common/shared_ptr.hh +++ b/dune/common/shared_ptr.hh @@ -126,7 +126,7 @@ namespace Dune template<class T> inline shared_ptr<T>::shared_ptr() { - rep_ = new PointerRep; + rep_ = NULL; } template<class T> diff --git a/dune/common/test/smartpointertest.cc b/dune/common/test/smartpointertest.cc index ff173fa68..ca8dbe20a 100644 --- a/dune/common/test/smartpointertest.cc +++ b/dune/common/test/smartpointertest.cc @@ -14,7 +14,7 @@ int main(){ using namespace Dune; int ret=0; { - shared_ptr<double> b; + shared_ptr<double> b(new double(42.0)); { shared_ptr<double> d(b); *b = 7; -- GitLab