diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-24 19:23:37 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-24 19:23:37 -0800 |
commit | cd03e291664cb102bde61d86a15f0add11809766 (patch) | |
tree | 9afb4bc872236b95debd5e20daf00797c563c666 /starts/meaning-vm/level-0/ref.hpp | |
parent | dbbed1e4e1d4b3f268c71236c89f1d673fa0c165 (diff) | |
download | standingwithresilience-cd03e291664cb102bde61d86a15f0add11809766.tar.gz standingwithresilience-cd03e291664cb102bde61d86a15f0add11809766.zip |
messy but works. rushing to get this done with may have been a poor investment.
Diffstat (limited to 'starts/meaning-vm/level-0/ref.hpp')
-rw-r--r-- | starts/meaning-vm/level-0/ref.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/starts/meaning-vm/level-0/ref.hpp b/starts/meaning-vm/level-0/ref.hpp index c1fa7fa..abe3897 100644 --- a/starts/meaning-vm/level-0/ref.hpp +++ b/starts/meaning-vm/level-0/ref.hpp @@ -11,16 +11,19 @@ namespace level0 { struct ref : public refmixin<ref, vref> { ref(concept *p); + ref(ref const & other) : ref(other.ptr) { } + ref & operator=(ref const & other) { self.ptr = other.ptr; return self; } operator concept*() const { return ptr; } concept* operator->() const { return ptr; } - bool operator==(ref const & other) const { return self.ptr == other.ptr; } - bool operator!=(ref const & other) const { return self.ptr != other.ptr; } - bool operator<(ref const & other) const { return self.ptr < other.ptr; } concept & deref() { return *ptr; } - std::string dump(ref skipmarkertype, ref skipmarkertarget) const; + ref & l0() { return self; } + ref const & l0() const { return self; } - concept * const ptr; + std::string dump(ref skipmarkertype, ref skipmarkertarget); + +private: + concept * ptr; }; } |