diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-03 15:09:05 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-03 15:09:05 +0100 |
commit | a2607bffb1c0f8699021b1b4b3e54fa372e3ed0a (patch) | |
tree | 6ce416f4be55b9d8e3f73d6556450ee86f18774e /src/example/proxy.cpp | |
parent | 83ce876b4c1b12c3654413515840f5f71907ea6c (diff) |
more WIP savemanager
Diffstat (limited to 'src/example/proxy.cpp')
-rw-r--r-- | src/example/proxy.cpp | 13 |
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; }, }; |