summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0/vref.hpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 14:09:27 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 14:09:27 -0800
commitf80b3ce2b52f568bb04005c24ad11c3a05cf7a15 (patch)
tree5744aa421d92a2887898900ea70924b30f015e82 /starts/meaning-vm/level-0/vref.hpp
parent9a14918abec434d8463e07635daef380ad630649 (diff)
downloadstandingwithresilience-f80b3ce2b52f568bb04005c24ad11c3a05cf7a15.tar.gz
standingwithresilience-f80b3ce2b52f568bb04005c24ad11c3a05cf7a15.zip
level0 few more checks
Diffstat (limited to 'starts/meaning-vm/level-0/vref.hpp')
-rw-r--r--starts/meaning-vm/level-0/vref.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/starts/meaning-vm/level-0/vref.hpp b/starts/meaning-vm/level-0/vref.hpp
index 7fe2045..cffc8f5 100644
--- a/starts/meaning-vm/level-0/vref.hpp
+++ b/starts/meaning-vm/level-0/vref.hpp
@@ -15,10 +15,11 @@ struct vref
value<T>* operator->() { return ptr; }
operator T const &() const { return *ptr; }
- vref(T const & val) : ptr(alloc(new value<T>(val))) { }
+ vref(T const & val) : vref(alloc(new value<T>(val))) { }
vref(ref const & other) : ptr(static_cast<value<T>*>(other.ptr)) { }
operator ref() { return ptr; }
+ T const & val() { return *ptr; }
// for use by containers
bool operator<(vref<T> const & other) const { return self.ptr < other.ptr; }