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:
Jelle Raaijmakers 2024-10-24 22:36:28 +02:00 committed by Andreas Kling
commit 0de403fede
Notes: github-actions[bot] 2024-10-25 07:16:17 +00:00
8 changed files with 11 additions and 11 deletions

View file

@ -168,7 +168,7 @@ public:
return as_nonnull_ptr();
}
ALWAYS_INLINE T& operator*() const
[[nodiscard]] ALWAYS_INLINE T& operator*() const
{
return *as_nonnull_ptr();
}