From d4976b3e6fddec7a8ee010a6278e5cbe005542b4 Mon Sep 17 00:00:00 2001 From: olpc user Date: Mon, 25 Nov 2019 17:55:34 -0800 Subject: add batch linking via initializer_list, also some missing changes --- starts/meaning-vm/level-0/baseref.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (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 b68de24..b4ceb02 100644 --- a/starts/meaning-vm/level-0/baseref.hpp +++ b/starts/meaning-vm/level-0/baseref.hpp @@ -36,6 +36,16 @@ public: array getAll(ref const & type) const; links_t links() const; + ref link(std::initializer_list refs) + { + for (auto it = refs.begin(); it != refs.end();) { + ref type = *it++; + ref target = *it++; + link(type, target); + } + return ptr(); + } + template T& vget(ref const & type) const { return p->vget(type.p)->data; } template -- cgit v1.2.3