fix: a workaround for msvc 1929 added to validated_type

This commit is contained in:
Mateusz Pusz
2023-03-30 17:05:04 +02:00
parent 56dcb716e3
commit 245783e89a

View File

@@ -61,6 +61,17 @@ public:
{ {
} }
#if UNITS_COMP_MSVC && UNITS_COMP_MSVC < 1930
constexpr explicit(false) operator T() const noexcept(std::is_nothrow_copy_constructible_v<T>)
requires std::copyable<T>
{
return value_;
}
#else
constexpr explicit(false) operator T() const& noexcept(std::is_nothrow_copy_constructible_v<T>) constexpr explicit(false) operator T() const& noexcept(std::is_nothrow_copy_constructible_v<T>)
requires std::copyable<T> requires std::copyable<T>
{ {
@@ -72,6 +83,8 @@ public:
return std::move(value_); return std::move(value_);
} }
#endif
constexpr T& value() & noexcept = delete; constexpr T& value() & noexcept = delete;
constexpr const T& value() const& noexcept { return value_; } constexpr const T& value() const& noexcept { return value_; }
constexpr T&& value() && noexcept { return std::move(value_); } constexpr T&& value() && noexcept { return std::move(value_); }