From 81ff242e8657b0647ece83c88b4b3a1454eb5a84 Mon Sep 17 00:00:00 2001 From: MacDue Date: Mon, 29 May 2023 19:02:00 +0100 Subject: [PATCH] AK: Mark generic shorthand functions as constexpr --- AK/GenericShorthands.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/AK/GenericShorthands.h b/AK/GenericShorthands.h index 73941857dfb..c2fd328a3d8 100644 --- a/AK/GenericShorthands.h +++ b/AK/GenericShorthands.h @@ -11,55 +11,55 @@ namespace AK { template -[[nodiscard]] bool first_is_one_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_one_of(T const to_compare, Ts const... valid_values) { return (... || (to_compare == valid_values)); } template -[[nodiscard]] bool first_is_smaller_than_one_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_smaller_than_one_of(T const to_compare, Ts const... valid_values) { return (... || (to_compare < valid_values)); } template -[[nodiscard]] bool first_is_smaller_or_equal_than_one_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_smaller_or_equal_than_one_of(T const to_compare, Ts const... valid_values) { return (... || (to_compare <= valid_values)); } template -[[nodiscard]] bool first_is_larger_than_one_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_larger_than_one_of(T const to_compare, Ts const... valid_values) { return (... || (to_compare > valid_values)); } template -[[nodiscard]] bool first_is_larger_or_equal_than_one_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_larger_or_equal_than_one_of(T const to_compare, Ts const... valid_values) { return (... || (to_compare >= valid_values)); } template -[[nodiscard]] bool first_is_smaller_than_all_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_smaller_than_all_of(T const to_compare, Ts const... valid_values) { return (... && (to_compare < valid_values)); } template -[[nodiscard]] bool first_is_smaller_or_equal_than_all_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_smaller_or_equal_than_all_of(T const to_compare, Ts const... valid_values) { return (... && (to_compare <= valid_values)); } template -[[nodiscard]] bool first_is_larger_than_all_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_larger_than_all_of(T const to_compare, Ts const... valid_values) { return (... && (to_compare > valid_values)); } template -[[nodiscard]] bool first_is_larger_or_equal_than_all_of(T const to_compare, Ts const... valid_values) +[[nodiscard]] constexpr bool first_is_larger_or_equal_than_all_of(T const to_compare, Ts const... valid_values) { return (... && (to_compare >= valid_values)); }