diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 090423dbf6c..75f1d4e8894 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -222,17 +222,11 @@ protected: template struct SettingHandler { - /** - * The `bool` argument is `true` if the value is being set to the default - * value. - * - * The `T &` argument is the value itself. - */ - std::function fun; + std::function fun = [](T & val) {}; SettingHandler() = default; - SettingHandler(std::function && fun) + SettingHandler(std::function && fun) : fun(std::move(fun)) { } @@ -294,9 +288,7 @@ public: , handler(handler) { options->addSetting(this); - if (handler) { - handler.fun(true, value); - } + handler.fun(value); } operator const T &() const { return value; } @@ -314,9 +306,7 @@ public: virtual void assign(const T & v) { value = v; - if (handler) { - handler.fun(false, value); - } + handler.fun(value); } void operator =(const T & v) { assign(v); }