mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:07:45 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
8639d8bc21
commit
d26aabff04
140 changed files with 1202 additions and 723 deletions
|
@ -148,7 +148,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U = JS::Completion>
|
||||
explicit(!IsConvertible<U&&, JS::Completion>) Optional(U&& value) requires(!IsSame<RemoveCVReference<U>, Optional<JS::Completion>> && IsConstructible<JS::Completion, U&&>)
|
||||
explicit(!IsConvertible<U&&, JS::Completion>) Optional(U&& value)
|
||||
requires(!IsSame<RemoveCVReference<U>, Optional<JS::Completion>> && IsConstructible<JS::Completion, U &&>)
|
||||
: m_value(forward<U>(value))
|
||||
{
|
||||
}
|
||||
|
@ -237,7 +238,8 @@ namespace JS {
|
|||
template<typename ValueType>
|
||||
class [[nodiscard]] ThrowCompletionOr {
|
||||
public:
|
||||
ThrowCompletionOr() requires(IsSame<ValueType, Empty>)
|
||||
ThrowCompletionOr()
|
||||
requires(IsSame<ValueType, Empty>)
|
||||
: m_value(Empty {})
|
||||
{
|
||||
}
|
||||
|
@ -266,7 +268,8 @@ public:
|
|||
// 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.
|
||||
template<typename WrappedValueType>
|
||||
ThrowCompletionOr(WrappedValueType value) requires(!IsPOD<ValueType>)
|
||||
ThrowCompletionOr(WrappedValueType value)
|
||||
requires(!IsPOD<ValueType>)
|
||||
: m_value(move(value))
|
||||
{
|
||||
}
|
||||
|
@ -274,8 +277,16 @@ public:
|
|||
[[nodiscard]] bool is_throw_completion() const { return m_throw_completion.has_value(); }
|
||||
Completion const& throw_completion() const { return *m_throw_completion; }
|
||||
|
||||
[[nodiscard]] bool has_value() const requires(!IsSame<ValueType, Empty>) { return m_value.has_value(); }
|
||||
[[nodiscard]] ValueType const& value() const requires(!IsSame<ValueType, Empty>) { return *m_value; }
|
||||
[[nodiscard]] bool has_value() const
|
||||
requires(!IsSame<ValueType, Empty>)
|
||||
{
|
||||
return m_value.has_value();
|
||||
}
|
||||
[[nodiscard]] ValueType const& value() const
|
||||
requires(!IsSame<ValueType, Empty>)
|
||||
{
|
||||
return *m_value;
|
||||
}
|
||||
|
||||
// These are for compatibility with the TRY() macro in AK.
|
||||
[[nodiscard]] bool is_error() const { return m_throw_completion.has_value(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue