aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/ref.h
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-07-01 02:40:45 -0400
committerDeterminant <ted.sybil@gmail.com>2019-07-01 02:40:45 -0400
commit19082449b9cc5f8004a9591af8e493c069671396 (patch)
tree31fb62acfe10fd650aa8e6efd25692b6b210253d /include/salticidae/ref.h
parent8bcaadaa42e2c91230faf850d10c29703578ef7b (diff)
better peer teardown
Diffstat (limited to 'include/salticidae/ref.h')
-rw-r--r--include/salticidae/ref.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/salticidae/ref.h b/include/salticidae/ref.h
index 44eb01e..9f4bfed 100644
--- a/include/salticidae/ref.h
+++ b/include/salticidae/ref.h
@@ -98,6 +98,11 @@ class _BoxObj {
T &operator *() const { return *obj; }
T *get() const { return obj; }
+ T *unwrap() {
+ auto ret = obj;
+ obj = nullptr;
+ return ret;
+ }
operator bool() const { return obj != nullptr; }
bool operator==(const _BoxObj &other) const { return obj == other.obj; }
bool operator!=(const _BoxObj &other) const { return obj != other.obj; }