mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
AK: Use Noncopyable.h
in Optional<T&>
This makes them trivially copyable/movable, silencing > "parameter is copied for each invocation" warnings on `Optional<T&>`, which are unnecessairy, since `Optional<T&>` is just a trivially copyable pointer. This creates a slight change in behaviour when moving out of an `Optional<T&>`, since the moved-from optional no longer gets cleared. Moved-from values should be considered to be in an undefined state, and if clearing a moved-from `Optional<T&>` is desired, you should be using `Optional<T&>::release_value()` instead.
This commit is contained in:
parent
7e78d7d332
commit
55383998b1
Notes:
github-actions[bot]
2024-12-04 00:59:45 +00:00
Author: https://github.com/yyny
Commit: 55383998b1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2567
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/gmta ✅
2 changed files with 3 additions and 31 deletions
|
@ -247,7 +247,6 @@ TEST_CASE(move_optional_reference)
|
|||
y = move(x);
|
||||
EXPECT_EQ(y.has_value(), true);
|
||||
EXPECT_EQ(y.value(), 3);
|
||||
EXPECT_EQ(x.has_value(), false);
|
||||
}
|
||||
|
||||
TEST_CASE(short_notation_reference)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue