pos_type: fix SPos(EPos)

This commit is contained in:
Christian Zimmermann 2024-09-20 00:11:58 +02:00
parent 2ca37810b2
commit 8b093baa8e

View file

@ -60,6 +60,10 @@ namespace CNORXZ
template <class PosT> template <class PosT>
constexpr decltype(auto) SPos<N>::operator*(const PosT& a) const constexpr decltype(auto) SPos<N>::operator*(const PosT& a) const
{ {
if constexpr(is_epos_type<PosT>::value){
return mkEPos<epos_size<PosT>::value>(*this,SPos<0>{}) * a;
}
else {
if constexpr(N == 0) { if constexpr(N == 0) {
return SPos<0>{}; return SPos<0>{};
} }
@ -70,11 +74,16 @@ namespace CNORXZ
return UPos(N*a.val()); return UPos(N*a.val());
} }
} }
}
template <SizeT N> template <SizeT N>
template <class PosT> template <class PosT>
constexpr decltype(auto) SPos<N>::operator()(const PosT& a) const constexpr decltype(auto) SPos<N>::operator()(const PosT& a) const
{ {
if constexpr(is_epos_type<PosT>::value){
return mkEPos<epos_size<PosT>::value>(*this,SPos<0>{}) * a;
}
else {
if constexpr(N == 0) { if constexpr(N == 0) {
return SPos<0>{}; return SPos<0>{};
} }
@ -85,6 +94,7 @@ namespace CNORXZ
return UPos(N*a.val()); return UPos(N*a.val());
} }
} }
}
template <SizeT N> template <SizeT N>
template <class PosT> template <class PosT>