diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-28 20:55:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-28 20:55:34 +0100 |
commit | 270878c74bb4c72e8ceab42b3758329f1edae6c2 (patch) | |
tree | 4b416957892a666ddc0800f5ae68b1205030735e /options/slider.hpp | |
parent | bfd866c6df75ad9dd805744c3acd2adf1b6644d8 (diff) |
options/slider: simplify, sprinkle constexpr
Diffstat (limited to 'options/slider.hpp')
-rw-r--r-- | options/slider.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/options/slider.hpp b/options/slider.hpp index abf39685..5d21bf0f 100644 --- a/options/slider.hpp +++ b/options/slider.hpp @@ -27,10 +27,7 @@ namespace options template<typename t, typename u, typename v> slider_value(t cur, u min, v max) : - cur_(double(cur)), - min_(double(min)), - max_(double(max)) - {} + slider_value((double)cur, (double)min, (double)max) {} slider_value& operator=(const slider_value& v) = default; slider_value(const slider_value& v) = default; @@ -39,9 +36,9 @@ namespace options bool operator==(const slider_value& v) const; bool operator!=(const slider_value& v) const; constexpr operator double() const { return cur_; } - double cur() const { return cur_; } - double min() const { return min_; } - double max() const { return max_; } + constexpr double cur() const { return cur_; } + constexpr double min() const { return min_; } + constexpr double max() const { return max_; } slider_value update_from_slider(int pos, int q_min, int q_max) const; int to_slider_pos(int q_min, int q_max) const; }; |