From 93655e3ce8163fb9cc58ac7f3cfe5c6ab73bcd4a Mon Sep 17 00:00:00 2001 From: Igor Zarzycki Date: Mon, 19 Aug 2024 17:02:52 +0200 Subject: [PATCH] Fix template keyword ambiguity. --- include/crap/numeric.d/innerproductvalue.h | 36 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/include/crap/numeric.d/innerproductvalue.h b/include/crap/numeric.d/innerproductvalue.h index 0a6eace..3f88fb5 100644 --- a/include/crap/numeric.d/innerproductvalue.h +++ b/include/crap/numeric.d/innerproductvalue.h @@ -28,11 +28,43 @@ namespace crap constexpr const static Type value = transform2Value :: template with :: template type :: value; using value_type = decltype(value); - constexpr operator value_type () const noexcept { return value; } + constexpr operator value_type () const noexcept; #if (crap_lib_integral_constant_callable >= 201304L) - constexpr value_type operator () () const noexcept { return value; } + constexpr value_type operator () () const noexcept; #endif }; } + +template class AdditiveOperator, template class MultiplicativeOperator, Type ... Values1> + template +inline constexpr crap :: innerProductValue :: + with :: operator typename +#if (!defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 10)) +crap :: innerProductValue :: template +#else +crap :: innerProductValue :: +#endif + with :: value_type () const noexcept +{ + return crap :: innerProductValue :: with :: value; +}; +#if (crap_lib_integral_constant_callable >= 201304L) + +template class AdditiveOperator, template class MultiplicativeOperator, Type ... Values1> + template +inline constexpr typename +//TODO: Add version check if changed by clang. +#if defined(__clang__) || (!defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 10)) + crap :: innerProductValue :: template +#else + crap :: innerProductValue :: +#endif + with :: value_type +crap :: innerProductValue :: + with :: operator () () const noexcept +{ + return crap :: innerProductValue :: with :: value; +}; +#endif #endif