mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 12:54:25 +02:00
refactor(example): ref qualifiers added to a conversion operator of validated_type
This commit is contained in:
@@ -61,12 +61,17 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
{
|
{
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr explicit(false) operator T() && noexcept(std::is_nothrow_move_constructible_v<T>)
|
||||||
|
{
|
||||||
|
return std::move(value_);
|
||||||
|
}
|
||||||
|
|
||||||
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_); }
|
||||||
|
Reference in New Issue
Block a user