mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibJS: Add explicit default copy+move constructors to ThrowCompletionOr
This stops clangd from complaining about not being able to determine the copy-constructibility of ThrowCompletionOr and Completion.
This commit is contained in:
parent
09a12247fb
commit
c79e4961f6
1 changed files with 10 additions and 0 deletions
|
@ -49,6 +49,11 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Completion(Completion const&) = default;
|
||||||
|
Completion& operator=(Completion const&) = default;
|
||||||
|
Completion(Completion&&) = default;
|
||||||
|
Completion& operator=(Completion&&) = default;
|
||||||
|
|
||||||
[[nodiscard]] Type type() const { return m_type; }
|
[[nodiscard]] Type type() const { return m_type; }
|
||||||
[[nodiscard]] Optional<Value>& value() { return m_value; }
|
[[nodiscard]] Optional<Value>& value() { return m_value; }
|
||||||
[[nodiscard]] Optional<Value> const& value() const { return m_value; }
|
[[nodiscard]] Optional<Value> const& value() const { return m_value; }
|
||||||
|
@ -112,6 +117,11 @@ public:
|
||||||
VERIFY(!m_value->is_empty());
|
VERIFY(!m_value->is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThrowCompletionOr(ThrowCompletionOr const&) = default;
|
||||||
|
ThrowCompletionOr& operator=(ThrowCompletionOr const&) = default;
|
||||||
|
ThrowCompletionOr(ThrowCompletionOr&&) = default;
|
||||||
|
ThrowCompletionOr& operator=(ThrowCompletionOr&&) = default;
|
||||||
|
|
||||||
// Allows implicit construction of ThrowCompletionOr<T> from a type U if T(U) is a supported constructor.
|
// Allows implicit construction of ThrowCompletionOr<T> from a type U if T(U) is a supported constructor.
|
||||||
// Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };".
|
// Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };".
|
||||||
// Disabled for POD types to avoid weird conversion shenanigans.
|
// Disabled for POD types to avoid weird conversion shenanigans.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue