diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:16:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-06-04 16:16:30 +0200 |
commit | 7f3437a771ae421f7f9dddc0b945c12e94d7a8c4 (patch) | |
tree | 2df129ba087bcfcb3dd99162647d8c8740042224 /cutl/shared-ptr.hxx | |
parent | 421ac51bafa3630e270a5046b9b3bd44859b71ad (diff) |
Add reset() to shared_ptr
Diffstat (limited to 'cutl/shared-ptr.hxx')
-rw-r--r-- | cutl/shared-ptr.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
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 { |