mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
LibJS: Use a forwarding reference in ThrowCompletion constructor
This avoids compiler complaints when trying to use const types
This commit is contained in:
parent
17a528c49e
commit
d4b08b7196
Notes:
sideshowbarker
2024-07-17 02:23:25 +09:00
Author: https://github.com/mattco98
Commit: d4b08b7196
Pull-request: https://github.com/SerenityOS/serenity/pull/17620
Issue: https://github.com/SerenityOS/serenity/issues/16988
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 1 deletions
|
@ -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 })
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue