From 0158a90868f347cef12fda09e30fe5ff892aa92f Mon Sep 17 00:00:00 2001 From: Igor Zarzycki Date: Tue, 17 Sep 2024 12:19:25 +0200 Subject: [PATCH] Make bitCeil function acting on values uniformly callable. --- include/crap/bit.d/bitceilvalue.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/crap/bit.d/bitceilvalue.h b/include/crap/bit.d/bitceilvalue.h index f6644a2..a90cdb8 100644 --- a/include/crap/bit.d/bitceilvalue.h +++ b/include/crap/bit.d/bitceilvalue.h @@ -15,6 +15,7 @@ #include "hassinglebitvalue.h" #include "../numbers.d/zero.h" #include "../version.d/char8t.h" +#include "../version.d/libintegralconstantcallable.h" #include "../version.d/unicodecharacters.h" #endif @@ -52,6 +53,9 @@ namespace crap ((floor == maxPower) && (shift == 1u)) ? zero : ((floor == zero) ? one : ((floor << shift) & ones)); using value_type = decltype(value); constexpr operator value_type () const noexcept; +#if (crap_lib_integral_constant_callable >= 201304L) + constexpr value_type operator () () const noexcept; +#endif }; #endif } @@ -64,6 +68,15 @@ typename crap :: bitCeilValue :: value_type () const noexcept { return crap :: bitCeilValue :: value; } +#if (crap_lib_integral_constant_callable >= 201304L) + +template +inline constexpr typename crap :: bitCeilValue :: value_type +crap :: bitCeilValue :: operator () () const noexcept +{ + return crap :: bitCeilValue :: value; +} +#endif #endif #endif