aboutsummaryrefslogtreecommitdiff
path: root/cutl/shared-ptr/base.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-06-04 16:16:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-06-04 16:16:30 +0200
commit7f3437a771ae421f7f9dddc0b945c12e94d7a8c4 (patch)
tree2df129ba087bcfcb3dd99162647d8c8740042224 /cutl/shared-ptr/base.txx
parent421ac51bafa3630e270a5046b9b3bd44859b71ad (diff)
Add reset() to shared_ptr
Diffstat (limited to 'cutl/shared-ptr/base.txx')
-rw-r--r--cutl/shared-ptr/base.txx9
1 files changed, 9 insertions, 0 deletions
diff --git a/cutl/shared-ptr/base.txx b/cutl/shared-ptr/base.txx
index 92ffa17..dae6083 100644
--- a/cutl/shared-ptr/base.txx
+++ b/cutl/shared-ptr/base.txx
@@ -103,6 +103,12 @@ namespace cutl
}
void
+ reset (X const* p)
+ {
+ counter_ = p ? bits::counter (p) : 0;
+ }
+
+ void
inc (X*)
{
(*counter_)++;
@@ -133,6 +139,9 @@ namespace cutl
counter_ops (Y const*) {}
void
+ reset (Y const*) {}
+
+ void
inc (shared_base* p) {p->_inc_ref ();}
void