From 3dc30f8e91ec3fd81c8e68a845632cd5e6a5a77b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 26 Jun 2018 22:53:01 +0200 Subject: options/slider: add missing `operator!=' --- options/slider.cpp | 15 +++++---------- options/slider.hpp | 6 ++++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/options/slider.cpp b/options/slider.cpp index d4f809c5..4f4124c6 100644 --- a/options/slider.cpp +++ b/options/slider.cpp @@ -32,16 +32,6 @@ slider_value::slider_value() : slider_value(0, 0, 0) { } -slider_value& slider_value::operator=(const slider_value& v) -{ - cur_ = v.cur_; - - min_ = v.min_; - max_ = v.max_; - - return *this; -} - bool slider_value::operator==(const slider_value& v) const { using std::fabs; @@ -57,6 +47,11 @@ bool slider_value::operator==(const slider_value& v) const #endif } +bool slider_value::operator!=(const slider_value& v) const +{ + return !(*this == v); +} + slider_value slider_value::update_from_slider(int pos, int q_min, int q_max) const { slider_value v(*this); diff --git a/options/slider.hpp b/options/slider.hpp index ab635d56..6c9c5a23 100644 --- a/options/slider.hpp +++ b/options/slider.hpp @@ -10,6 +10,8 @@ #include "export.hpp" #include "compat/macros.hpp" +#include + #include #include #include @@ -33,15 +35,15 @@ namespace options template cc_noinline - explicit operator arith_conversion_t() const + operator arith_conversion_t() const { return t(cur_); } slider_value(const slider_value& v); slider_value(); - slider_value& operator=(const slider_value& v); bool operator==(const slider_value& v) const; + bool operator!=(const slider_value& v) const; operator double() const { return cur_; } double cur() const { return cur_; } double min() const { return min_; } -- cgit v1.2.3