From a40abd6ce3a032b1baf52c3573ff02ad658c6e91 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Mon, 19 Oct 2020 12:30:30 -0400 Subject: Checked: constexpr support Problem: - `Checked` is not `constexpr`-aware. Solution: - Decorate member functions with `constexpr` keyword. - Add tests to ensure the functionality where possible. --- AK/StdLibExtras.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'AK/StdLibExtras.h') diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index e8e02703ee..02032ea1e2 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -82,7 +82,7 @@ inline constexpr T ceil_div(T a, U b) # pragma clang diagnostic ignored "-Wconsumed" #endif template -inline T&& move(T& arg) +constexpr T&& move(T& arg) { return static_cast(arg); } @@ -433,7 +433,7 @@ struct IsConst : TrueType { }; template -inline constexpr T exchange(T& slot, U&& value) +constexpr T exchange(T& slot, U&& value) { T old_value = move(slot); slot = forward(value); -- cgit v1.2.3