diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-04-11 01:21:37 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-11 12:50:33 +0200 |
commit | 5165661799cce735db2e79a32d4207854fad29a9 (patch) | |
tree | 200bbde85246c0772d1ae2715786e1b56d6c6f49 /AK | |
parent | b6726df82843711dcd3fd8d3ea3d1f5de194e519 (diff) | |
download | serenity-5165661799cce735db2e79a32d4207854fad29a9.zip |
AK: Annotate Checked functions with [[nodiscard]]
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Checked.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/AK/Checked.h b/AK/Checked.h index eaeb1bc3f2..8d5321d5b6 100644 --- a/AK/Checked.h +++ b/AK/Checked.h @@ -104,7 +104,7 @@ struct TypeBoundsChecker<Destination, Source, true, true, false> { }; template<typename Destination, typename Source> -constexpr bool is_within_range(Source value) +[[nodiscard]] constexpr bool is_within_range(Source value) { return TypeBoundsChecker<Destination, Source>::is_within_range(value); } @@ -149,7 +149,7 @@ public: return *this; } - constexpr bool has_overflow() const + [[nodiscard]] constexpr bool has_overflow() const { return m_overflow; } @@ -265,7 +265,7 @@ public: } template<typename U, typename V> - static constexpr bool addition_would_overflow(U u, V v) + [[nodiscard]] static constexpr bool addition_would_overflow(U u, V v) { #ifdef __clang__ Checked checked; @@ -278,7 +278,7 @@ public: } template<typename U, typename V> - static constexpr bool multiplication_would_overflow(U u, V v) + [[nodiscard]] static constexpr bool multiplication_would_overflow(U u, V v) { #ifdef __clang__ Checked checked; @@ -291,7 +291,7 @@ public: } template<typename U, typename V, typename X> - static constexpr bool multiplication_would_overflow(U u, V v, X x) + [[nodiscard]] static constexpr bool multiplication_would_overflow(U u, V v, X x) { Checked checked; checked = u; |