#pragma once #include #include "ValueBroker.h" namespace crepe { template ValueBroker::ValueBroker(T & value) : value(value), setter([] (T & value, const T & target) { value = std::move(target); }), getter([] (T & value) -> const int & { return value; }) { } template ValueBroker::ValueBroker(T & value, const setter_t & setter, const getter_t & getter) : value(value), setter(setter), getter(getter) { } template const T & ValueBroker::get() { return this->getter(this->value); } template void ValueBroker::set(const T & value) { this->setter(this->value, value); } }