mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS: Use a forwarding reference in ThrowCompletion constructor
This avoids compiler complaints when trying to use const types
This commit is contained in:
committed by
Linus Groh
parent
17a528c49e
commit
d4b08b7196
@@ -307,7 +307,7 @@ 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 const& value)
|
||||
ThrowCompletionOr(WrappedValueType&& value)
|
||||
requires(!IsPOD<ValueType>)
|
||||
: m_value_or_throw_completion(ValueType { value })
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user