diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-26 08:26:40 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-26 08:26:40 -0800 |
commit | dc2779f5a7ceb226620f39e728b73b028cb17c10 (patch) | |
tree | 5053af30bb6e49a9c17291626a5cb375df260bcf /starts/meaning-vm/level-2/baseref.hpp | |
parent | ff4aecf759ce565b77575ad8eabcf60c94ee6a29 (diff) | |
download | standingwithresilience-dc2779f5a7ceb226620f39e728b73b028cb17c10.tar.gz standingwithresilience-dc2779f5a7ceb226620f39e728b73b028cb17c10.zip |
start closing habit starts in level2
Diffstat (limited to 'starts/meaning-vm/level-2/baseref.hpp')
-rw-r--r-- | starts/meaning-vm/level-2/baseref.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/starts/meaning-vm/level-2/baseref.hpp b/starts/meaning-vm/level-2/baseref.hpp index 8fbcc91..644f4b8 100644 --- a/starts/meaning-vm/level-2/baseref.hpp +++ b/starts/meaning-vm/level-2/baseref.hpp @@ -1,10 +1,8 @@ #pragma once #include "common.hpp" - #include "funcs.hpp" - -#include "../level-1/common.hpp" +#include "../level-1/baseref.hpp" #include <functional> @@ -21,10 +19,13 @@ struct baseref : public level1::baseref<ref> template <typename... Refs> ref operator()(ref first, Refs... rest) { return level2::dohabit(self, {first, rest...}); } - template <typename... Pairs> - ref operator()(std::initializer_list<ref> first, Pairs... rest) { return level2::dohabit(self, {first, rest...}); } - + ref operator()(std::initializer_list<std::initializer_list<ref>> pairs) { return level2::dohabit(self, pairs); } ref operator()() { return level2::dohabit(self); } + + template <typename... Refs> + ref act(ref habit, Refs... rest) { return level2::dohabit(habit, {self, rest...}); } + + void replace(ref other) { *self.ptr() = *other.ptr(); } }; } |