summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/options.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack-compat/options.hpp')
-rw-r--r--opentrack-compat/options.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/opentrack-compat/options.hpp b/opentrack-compat/options.hpp
index 53249746..fd4a82a5 100644
--- a/opentrack-compat/options.hpp
+++ b/opentrack-compat/options.hpp
@@ -234,7 +234,7 @@ namespace options {
public:
using underlying_t = typename get_t<t_>::t;
- t operator=(const t datum)
+ t operator=(const t& datum)
{
store(static_cast<underlying_t>(datum));
return datum;
@@ -256,7 +256,7 @@ namespace options {
{
}
- operator t() const
+ t get() const
{
t val = b->contains(self_name)
? static_cast<t>(b->get<underlying_t>(self_name))
@@ -264,10 +264,13 @@ namespace options {
return detail::value_get_traits<t>::get(val, def);
}
+ operator t() const { return get(); }
+
void reload() override
{
*this = static_cast<t>(*this);
}
+
private:
t def;
};