diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 17:55:34 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-25 17:55:34 -0800 |
commit | d4976b3e6fddec7a8ee010a6278e5cbe005542b4 (patch) | |
tree | edb6c08843318dcefb4896eca141b7aeff1a78c6 /starts/meaning-vm/level-0 | |
parent | 59a4cccd495e925703dbbce74e733efd8e453f16 (diff) | |
download | standingwithresilience-d4976b3e6fddec7a8ee010a6278e5cbe005542b4.tar.gz standingwithresilience-d4976b3e6fddec7a8ee010a6278e5cbe005542b4.zip |
add batch linking via initializer_list, also some missing changes
Diffstat (limited to 'starts/meaning-vm/level-0')
-rw-r--r-- | starts/meaning-vm/level-0/baseref.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<ref> refs) + { + for (auto it = refs.begin(); it != refs.end();) { + ref type = *it++; + ref target = *it++; + link(type, target); + } + return ptr(); + } + template <typename T> T& vget(ref const & type) const { return p->vget<T>(type.p)->data; } template <typename T> |