|
|
@@ -24,7 +24,7 @@ public:
|
|
|
"The minimum value must be less than or equal to the maximum");
|
|
|
|
|
|
using value_type = T;
|
|
|
- using underlying_type = value_type;
|
|
|
+ using underlying_type = value_type const &;
|
|
|
using bound_type =
|
|
|
std::common_type_t<decltype(MAXIMUM_VALUE), decltype(MINIMUM_VALUE)>;
|
|
|
|
|
|
@@ -41,12 +41,12 @@ public:
|
|
|
|
|
|
Bound(AssertBounds, value_type val) : value_(assert_in_bounds(val, min, max)) {}
|
|
|
|
|
|
- operator value_type const &() const { return value_; }
|
|
|
+ explicit operator value_type const &() const { return value_; }
|
|
|
value_type const &operator*() const { return value_; }
|
|
|
value_type const *operator->() const { return &value_; }
|
|
|
|
|
|
auto operator<=>(Bound const &other) const noexcept = default;
|
|
|
-
|
|
|
+
|
|
|
template <typename F> void mutate(F &&func) {
|
|
|
std::forward<F>(func)(value_);
|
|
|
*this = Bound(value_);
|