my_value constructor refactored

This commit is contained in:
Mateusz Pusz
2019-11-02 13:58:35 +01:00
parent 7da63eedfd
commit 367c7d5b6e

View File

@@ -36,7 +36,7 @@ namespace {
T value_{}; T value_{};
public: public:
my_value() = default; my_value() = default;
constexpr my_value(T v) : value_{std::move(v)} {} constexpr my_value(T v) : value_(std::move(v)) {}
constexpr my_value& operator+=(const my_value& other) { value_ += other.value_; return *this; } constexpr my_value& operator+=(const my_value& other) { value_ += other.value_; return *this; }
constexpr my_value& operator-=(const my_value& other) { value_ -= other.value_; return *this; } constexpr my_value& operator-=(const my_value& other) { value_ -= other.value_; return *this; }
constexpr my_value& operator*=(const my_value& other) { value_ *= other.value_; return *this; } constexpr my_value& operator*=(const my_value& other) { value_ *= other.value_; return *this; }