summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-0
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-05 04:12:23 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-05 04:12:23 -0800
commit680af2ca0b1ced4c82bbce620d6c4fc97dae88d0 (patch)
tree1a833fe6f12a1eb00aa9bc6659a09c2c338cbdea /starts/meaning-vm/level-0
parentcae16e6c034808199f12a37ec0bdb4822c988dca (diff)
downloadstandingwithresilience-680af2ca0b1ced4c82bbce620d6c4fc97dae88d0.tar.gz
standingwithresilience-680af2ca0b1ced4c82bbce620d6c4fc97dae88d0.zip
add function syntaxes
Diffstat (limited to 'starts/meaning-vm/level-0')
-rw-r--r--starts/meaning-vm/level-0/baseref.hpp4
-rw-r--r--starts/meaning-vm/level-0/concept.hpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/starts/meaning-vm/level-0/baseref.hpp b/starts/meaning-vm/level-0/baseref.hpp
index 205b422..77c783d 100644
--- a/starts/meaning-vm/level-0/baseref.hpp
+++ b/starts/meaning-vm/level-0/baseref.hpp
@@ -51,10 +51,12 @@ public:
template <typename T>
T& vget(ref const & type) const { return p->vget<T>(type.p); }
template <typename T>
- void vset(ref const & type, T const & v) { p->set(type.p, alloc(v)); }
+ void vset(ref const & type, T const & v) { p->set(type.p, level0::alloc(v)); }
template <typename T>
T& val() { return p->val<T>(); }
+ template <typename T>
+ void val(T const & v) { p->val<T>(v); }
operator concept*() const { return p; }
concept*& ptr() { return p; }
diff --git a/starts/meaning-vm/level-0/concept.hpp b/starts/meaning-vm/level-0/concept.hpp
index d57ccfc..d42d36b 100644
--- a/starts/meaning-vm/level-0/concept.hpp
+++ b/starts/meaning-vm/level-0/concept.hpp
@@ -38,6 +38,9 @@ struct concept
template <typename T>
T & val() { return std::any_cast<T&>(data); }
+
+ template <typename T>
+ void val(T const & v) { data = v; }
};
}