From 680af2ca0b1ced4c82bbce620d6c4fc97dae88d0 Mon Sep 17 00:00:00 2001 From: olpc user Date: Thu, 5 Dec 2019 04:12:23 -0800 Subject: add function syntaxes --- starts/meaning-vm/level-0/baseref.hpp | 4 +++- starts/meaning-vm/level-0/concept.hpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'starts/meaning-vm/level-0') 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 T& vget(ref const & type) const { return p->vget(type.p); } template - 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 T& val() { return p->val(); } + template + void val(T const & v) { p->val(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 T & val() { return std::any_cast(data); } + + template + void val(T const & v) { data = v; } }; } -- cgit v1.2.3