aboutsummaryrefslogtreecommitdiff
path: root/src/example/proxy.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-03 15:09:05 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-03 15:09:05 +0100
commita2607bffb1c0f8699021b1b4b3e54fa372e3ed0a (patch)
tree6ce416f4be55b9d8e3f73d6556450ee86f18774e /src/example/proxy.cpp
parent83ce876b4c1b12c3654413515840f5f71907ea6c (diff)
more WIP savemanager
Diffstat (limited to 'src/example/proxy.cpp')
-rw-r--r--src/example/proxy.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/example/proxy.cpp b/src/example/proxy.cpp
index 7c2cb8d..0be4fac 100644
--- a/src/example/proxy.cpp
+++ b/src/example/proxy.cpp
@@ -23,14 +23,13 @@ int main() {
int real_value = 0;
ValueBroker<int> broker {
- real_value,
- [] (int & value, const int & target) {
- dbg_logf("set %s to %s", to_string(value).c_str(), to_string(target).c_str());
- value = target;
+ [&real_value] (const int & target) {
+ dbg_logf("set %s to %s", to_string(real_value).c_str(), to_string(target).c_str());
+ real_value = target;
},
- [] (int & value) -> const int & {
- dbg_logf("get %s", to_string(value).c_str());
- return value;
+ [&real_value] () -> const int & {
+ dbg_logf("get %s", to_string(real_value).c_str());
+ return real_value;
},
};