mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 15:58:56 +00:00
AK+LibJS: Add [[nodiscard]]
to operator*
in common types
The order of precedence with the `*` operator sometimes makes it a bit harder to detect whether or not the result is actually used. Let's fail compilation if anyone tries to discard the result.
This commit is contained in:
parent
5ab07f277c
commit
0de403fede
Notes:
github-actions[bot]
2024-10-25 07:16:17 +00:00
Author: https://github.com/gmta
Commit: 0de403fede
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1946
8 changed files with 11 additions and 11 deletions
|
@ -168,7 +168,7 @@ public:
|
|||
return as_nonnull_ptr();
|
||||
}
|
||||
|
||||
ALWAYS_INLINE T& operator*() const
|
||||
[[nodiscard]] ALWAYS_INLINE T& operator*() const
|
||||
{
|
||||
return *as_nonnull_ptr();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue