From 8172f109ed55b8a02e7e498566b7ba12e346f7e2 Mon Sep 17 00:00:00 2001 From: olpc user Date: Mon, 25 Nov 2019 17:35:09 -0800 Subject: add vset --- starts/meaning-vm/level-0/baseref.hpp | 3 +++ starts/meaning-vm/level-0/memorystore.hpp | 1 - 2 files changed, 3 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 bdfd065..b68de24 100644 --- a/starts/meaning-vm/level-0/baseref.hpp +++ b/starts/meaning-vm/level-0/baseref.hpp @@ -2,6 +2,7 @@ #include "common.hpp" #include "errors.hpp" +#include "memorystore.hpp" #include #include @@ -37,6 +38,8 @@ public: template T& vget(ref const & type) const { return p->vget(type.p)->data; } + template + void vset(ref const & type, T const & v) { p->set(type.p, valloc(v)); } template T& val() { return p->val()->data; } diff --git a/starts/meaning-vm/level-0/memorystore.hpp b/starts/meaning-vm/level-0/memorystore.hpp index cdd7462..8958ae7 100644 --- a/starts/meaning-vm/level-0/memorystore.hpp +++ b/starts/meaning-vm/level-0/memorystore.hpp @@ -1,7 +1,6 @@ #pragma once #include "common.hpp" -#include "ref.hpp" #include "value.hpp" namespace intellect { -- cgit v1.2.3