diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 08:42:45 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 08:42:45 -0800 |
commit | 684ac69af192670bb6547ec01df19a3159e7d8e6 (patch) | |
tree | e6c6762e9fc40cf0ad557e160e9ab6ba7bb99eea /starts/meaning-vm/level-0/vref.hpp | |
parent | 520119a6f6ed418b8ae45bfde8239bbb532562cd (diff) | |
download | standingwithresilience-684ac69af192670bb6547ec01df19a3159e7d8e6.tar.gz standingwithresilience-684ac69af192670bb6547ec01df19a3159e7d8e6.zip |
separate functionality out a bit
Diffstat (limited to 'starts/meaning-vm/level-0/vref.hpp')
-rw-r--r-- | starts/meaning-vm/level-0/vref.hpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/starts/meaning-vm/level-0/vref.hpp b/starts/meaning-vm/level-0/vref.hpp deleted file mode 100644 index 1eb701d..0000000 --- a/starts/meaning-vm/level-0/vref.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include "common.hpp" -#include "memorystore.hpp" -#include "ref.hpp" -#include "value.hpp" - -namespace intellect { -namespace level0 { - -template <typename T> -struct vref -{ - vref(value<T> *p) : ptr(p) { } - value<T>* operator->() { return ptr; } - operator T const &() const { return *ptr; } - - vref(T const & val) : vref(alloc(new value<T>(val))) { } - - vref(ref const & other) : ptr(static_cast<value<T>*>((concept*)other)) { } - 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; } - -protected: - value<T> * const ptr; -}; - - -} -} |