From 8b093baa8ed007226ee0e275b8bcdc13f4be3e84 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Fri, 20 Sep 2024 00:11:58 +0200 Subject: [PATCH] pos_type: fix SPos(EPos) --- src/include/xpr/pos_type.cc.h | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/include/xpr/pos_type.cc.h b/src/include/xpr/pos_type.cc.h index 8ee443e..1f051e3 100644 --- a/src/include/xpr/pos_type.cc.h +++ b/src/include/xpr/pos_type.cc.h @@ -60,14 +60,19 @@ namespace CNORXZ template constexpr decltype(auto) SPos::operator*(const PosT& a) const { - if constexpr(N == 0) { - return SPos<0>{}; - } - else if constexpr(is_static_pos_type::value){ - return SPos{}; + if constexpr(is_epos_type::value){ + return mkEPos::value>(*this,SPos<0>{}) * a; } else { - return UPos(N*a.val()); + if constexpr(N == 0) { + return SPos<0>{}; + } + else if constexpr(is_static_pos_type::value){ + return SPos{}; + } + else { + return UPos(N*a.val()); + } } } @@ -75,14 +80,19 @@ namespace CNORXZ template constexpr decltype(auto) SPos::operator()(const PosT& a) const { - if constexpr(N == 0) { - return SPos<0>{}; - } - else if constexpr(is_static_pos_type::value){ - return SPos{}; + if constexpr(is_epos_type::value){ + return mkEPos::value>(*this,SPos<0>{}) * a; } else { - return UPos(N*a.val()); + if constexpr(N == 0) { + return SPos<0>{}; + } + else if constexpr(is_static_pos_type::value){ + return SPos{}; + } + else { + return UPos(N*a.val()); + } } }