From 96a2e495f74ac05d624b68cbe103a4d61210d2b5 Mon Sep 17 00:00:00 2001 From: Igor Zarzycki Date: Tue, 17 Sep 2024 16:03:38 +0200 Subject: [PATCH] Make rotl function acting on values uniformly callable. --- include/crap/bit.d/rotlvalue.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/crap/bit.d/rotlvalue.h b/include/crap/bit.d/rotlvalue.h index d890c65..8b2ec94 100644 --- a/include/crap/bit.d/rotlvalue.h +++ b/include/crap/bit.d/rotlvalue.h @@ -13,6 +13,7 @@ #include "../numbers.d/zero.h" #include "../version.d/char8t.h" +#include "../version.d/libintegralconstantcallable.h" #include "../version.d/unicodecharacters.h" #endif @@ -50,6 +51,9 @@ namespace crap constexpr const static Type value = (left | right); 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 } @@ -62,6 +66,15 @@ typename crap :: rotlValue :: value_type () const noexcept { return crap :: rotlValue :: value; } +#if (crap_lib_integral_constant_callable >= 201304L) + +template +inline constexpr typename crap :: rotlValue :: value_type +crap :: rotlValue :: operator () () const noexcept +{ + return crap :: rotlValue :: value; +} +#endif #endif #endif