summaryrefslogtreecommitdiff
path: root/src/state.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-04-24 21:20:25 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2021-04-24 21:20:25 +0200
commita511d2d1ef5fa07dde601961fe9394b474aad5ae (patch)
tree9dd7321cba6303583d044cae95ea622e96b55d45 /src/state.cpp
parent9aaba1211c95dc7e08437a7cca73452181e296d6 (diff)
Behavior lens for shared refs from local state
Diffstat (limited to 'src/state.cpp')
-rw-r--r--src/state.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/state.cpp b/src/state.cpp
index 6e39b5e..1a3381a 100644
--- a/src/state.cpp
+++ b/src/state.cpp
@@ -153,3 +153,15 @@ Ref SharedState::store(const Storage & st) const
return st.storeObject(Record(std::move(items)));
}
+
+template<>
+optional<Identity> LocalState::lens<optional<Identity>>(const LocalState & x)
+{
+ return x.identity();
+}
+
+template<>
+vector<Ref> LocalState::lens<vector<Ref>>(const LocalState & x)
+{
+ return x.sharedRefs();
+}