refactor(example): ref qualifiers added to a conversion operator of validated_type
This commit is contained in:
1 parent
bdbf2c37f8
commit
4dca00617c
1 file changed
+6
-1
@@ -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>
|
||||
{
|
||||
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 const T& value() const& noexcept { return value_; }
|
||||
constexpr T&& value() && noexcept { return std::move(value_); }
|
||||
|
||||
Reference in new issue
Block a user