mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-06 16:08:25 +01:00
be_val: Remove usage of constexpr for supporting older gcc versions.
This commit is contained in:
parent
9ffe296274
commit
10a085dd23
@ -60,58 +60,34 @@ public:
|
||||
}
|
||||
|
||||
template<typename OtherType,
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value ||
|
||||
std::is_convertible<const OtherType &, value_type>::value>::type>
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
be_val & operator =(const OtherType &other)
|
||||
{
|
||||
if constexpr (std::is_constructible<value_type, const OtherType &>::value) {
|
||||
setValue(value_type { other });
|
||||
} else {
|
||||
setValue(static_cast<value_type>(other));
|
||||
}
|
||||
|
||||
setValue(value_type { other });
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename OtherType,
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value ||
|
||||
std::is_convertible<const OtherType &, value_type>::value>::type>
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
be_val & operator =(OtherType &&other)
|
||||
{
|
||||
if constexpr (std::is_constructible<value_type, const OtherType &>::value) {
|
||||
setValue(value_type { std::forward<OtherType>(other) });
|
||||
} else {
|
||||
setValue(static_cast<value_type>(std::forward<OtherType>(other)));
|
||||
}
|
||||
|
||||
setValue(value_type { std::forward<OtherType>(other) });
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename OtherType,
|
||||
typename = typename std::enable_if<std::is_convertible<const OtherType &, value_type>::value ||
|
||||
std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
be_val & operator =(const be_val<OtherType> &other)
|
||||
{
|
||||
if constexpr (std::is_constructible<value_type, const OtherType &>::value) {
|
||||
setValue(value_type { other.value() });
|
||||
} else {
|
||||
setValue(static_cast<value_type>(other.value()));
|
||||
}
|
||||
|
||||
setValue(value_type { other.value() });
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename OtherType,
|
||||
typename = typename std::enable_if<std::is_convertible<const OtherType &, value_type>::value ||
|
||||
std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
typename = typename std::enable_if<std::is_constructible<value_type, const OtherType &>::value>::type>
|
||||
be_val & operator =(be_val<OtherType> &&other)
|
||||
{
|
||||
if constexpr (std::is_constructible<value_type, const OtherType &>::value) {
|
||||
setValue(value_type { other.value() });
|
||||
} else {
|
||||
setValue(static_cast<value_type>(other.value()));
|
||||
}
|
||||
|
||||
setValue(value_type { other.value() });
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user