diff --git a/AK/Checked.h b/AK/Checked.h index 3ed63f0132..eaeb1bc3f2 100644 --- a/AK/Checked.h +++ b/AK/Checked.h @@ -251,6 +251,19 @@ public: return old; } + constexpr Checked& operator--() + { + sub(1); + return *this; + } + + constexpr Checked operator--(int) + { + Checked old { *this }; + sub(1); + return old; + } + template static constexpr bool addition_would_overflow(U u, V v) {