From afa989e32c9bc3b55f3ea6cf594694cd397a687e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 16 Dec 2021 22:16:03 +0100 Subject: [PATCH] cleanup: replace std::size() replacement by real deal At other places, we already used std::size(). Signed-off-by: Berthold Stoeger --- core/filterconstraint.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/core/filterconstraint.cpp b/core/filterconstraint.cpp index 8f7b27246..7a8e632ca 100644 --- a/core/filterconstraint.cpp +++ b/core/filterconstraint.cpp @@ -104,26 +104,19 @@ static const char *negate_description[2] { QT_TRANSLATE_NOOP("gettextFromC", "is not"), }; -// std::size() is only available starting in C++17, so let's roll our own. -template -static constexpr size_t array_size(const T (&)[N]) -{ - return N; -} - static constexpr size_t type_descriptions_count() { - return array_size(type_descriptions); + return std::size(type_descriptions); } static constexpr size_t string_mode_descriptions_count() { - return array_size(string_mode_descriptions); + return std::size(string_mode_descriptions); } static constexpr size_t range_mode_descriptions_count() { - return array_size(range_mode_descriptions); + return std::size(range_mode_descriptions); } static const type_description *get_type_description(enum filter_constraint_type type)