diff --git a/tools/common/be_val.h b/tools/common/be_val.h index ba2d17b..50d893c 100644 --- a/tools/common/be_val.h +++ b/tools/common/be_val.h @@ -60,58 +60,34 @@ public: } template::value || - std::is_convertible::value>::type> + typename = typename std::enable_if::value>::type> be_val & operator =(const OtherType &other) { - if constexpr (std::is_constructible::value) { - setValue(value_type { other }); - } else { - setValue(static_cast(other)); - } - + setValue(value_type { other }); return *this; } template::value || - std::is_convertible::value>::type> + typename = typename std::enable_if::value>::type> be_val & operator =(OtherType &&other) { - if constexpr (std::is_constructible::value) { - setValue(value_type { std::forward(other) }); - } else { - setValue(static_cast(std::forward(other))); - } - + setValue(value_type { std::forward(other) }); return *this; } template::value || - std::is_constructible::value>::type> + typename = typename std::enable_if::value>::type> be_val & operator =(const be_val &other) { - if constexpr (std::is_constructible::value) { - setValue(value_type { other.value() }); - } else { - setValue(static_cast(other.value())); - } - + setValue(value_type { other.value() }); return *this; } template::value || - std::is_constructible::value>::type> + typename = typename std::enable_if::value>::type> be_val & operator =(be_val &&other) { - if constexpr (std::is_constructible::value) { - setValue(value_type { other.value() }); - } else { - setValue(static_cast(other.value())); - } - + setValue(value_type { other.value() }); return *this; }