From 53902262040c77423591ea57ae43ab38cda655dc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 26 Jun 2018 22:53:29 +0200 Subject: options/value: add missing dereference operator --- migration/20171013_00-tracker-pt-threshold.cpp | 2 +- options/value.hpp | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/migration/20171013_00-tracker-pt-threshold.cpp b/migration/20171013_00-tracker-pt-threshold.cpp index c9c070fa..89becb3f 100644 --- a/migration/20171013_00-tracker-pt-threshold.cpp +++ b/migration/20171013_00-tracker-pt-threshold.cpp @@ -43,7 +43,7 @@ struct move_int_to_slider : migration value old_val(b, old_name, 128); value new_val(b, new_name, { 128, 0, 255 }); - new_val = { old_val.to(), 0, 255 }; + new_val = { *old_val, 0, 255 }; b->save(); } diff --git a/options/value.hpp b/options/value.hpp index f1e44677..e73456ca 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -15,7 +15,6 @@ #include "base-value.hpp" #include "value-traits.hpp" #include "compat/macros.hpp" -#include "compat/linkage-macros.hpp" #include #include @@ -85,12 +84,6 @@ public: DIRECT_CONNTYPE); } - template - inline value(bundle b, const char (&name)[k], t def) : value(b, QLatin1String(name, k-1), def) - { - static_assert(k > 0, ""); - } - cc_noinline t default_value() const { @@ -103,10 +96,8 @@ public: *this = def; } - cc_noinline operator t() const { return get(); } - cc_noinline t operator->() const { return get(); @@ -126,14 +117,17 @@ public: emit valueChanged(traits::to_storage(get())); } - cc_noinline t operator()() const { return get(); } + t operator*() const + { + return get(); + } + template - cc_noinline u to() const { return static_cast(get()); -- cgit v1.2.3