From cd03e291664cb102bde61d86a15f0add11809766 Mon Sep 17 00:00:00 2001 From: olpc user Date: Sun, 24 Nov 2019 19:23:37 -0800 Subject: messy but works. rushing to get this done with may have been a poor investment. --- starts/meaning-vm/level-0/ref.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'starts/meaning-vm/level-0/ref.hpp') 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(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; }; } -- cgit v1.2.3