From 06f849695d651f308d8daf0d0826747032fa5f5b Mon Sep 17 00:00:00 2001 From: silverqx Date: Sun, 4 Aug 2024 13:17:02 +0200 Subject: [PATCH] added requires constraints to IntegralCast<> --- include/orm/utils/integralcast.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/orm/utils/integralcast.hpp b/include/orm/utils/integralcast.hpp index a563aa455..0da6435e3 100644 --- a/include/orm/utils/integralcast.hpp +++ b/include/orm/utils/integralcast.hpp @@ -20,7 +20,7 @@ namespace Private !std::same_as && !std::same_as; /*! Get integral type name as a string. */ - template + template requires (!std::is_reference_v) constexpr const char *IntegralTypeName() noexcept { // Sorted by most used types @@ -103,7 +103,7 @@ namespace Private /*! Format the given integer number (insert group separator before every 3th number). */ - template + template requires (!std::is_reference_v) QString formatNumber(const T integer, QChar groupSeparator = Constants::SQUOTE) { constexpr static QString::size_type groupWidth = 3; @@ -147,6 +147,7 @@ namespace Private /*! Determine whether the given value is in the T type range (min/max). */ template + requires (!std::is_reference_v && !std::is_reference_v) bool InRange(const V value) noexcept { /* This method must mirror or follow steps in Usual arithmetic conversions - @@ -210,6 +211,7 @@ namespace Private /*! Cast the given integral value to the T type with range checks, throw if failed. */ template +requires (!std::is_reference_v && !std::is_reference_v) auto IntegralCast(const V value) { if (Private::InRange(value))