From 7f3437a771ae421f7f9dddc0b945c12e94d7a8c4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:16:30 +0200 Subject: Add reset() to shared_ptr --- cutl/shared-ptr.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cutl/shared-ptr.hxx') diff --git a/cutl/shared-ptr.hxx b/cutl/shared-ptr.hxx index 0fc948b..de85447 100644 --- a/cutl/shared-ptr.hxx +++ b/cutl/shared-ptr.hxx @@ -118,6 +118,16 @@ namespace cutl return r; } + void + reset (X* x) + { + if (x_ != 0) + base::dec (x_); + + base::reset (x); + x_ = x; + } + std::size_t count () const { -- cgit v1.1