minor changes

This commit is contained in:
Christian Zimmermann 2024-07-10 14:39:04 +02:00
parent 8c35113967
commit 3086bf54ab
2 changed files with 22 additions and 24 deletions

View file

@ -36,40 +36,40 @@ namespace CNORXZ
template <SizeT N> template <SizeT N>
template <SizeT N1> template <SizeT N1>
constexpr auto SPos<N>::operator+(const SPos<N1>& a) const constexpr decltype(auto) SPos<N>::operator+(const SPos<N1>& a) const
{ {
return SPos<N+N1>(); return SPos<N+N1>();
} }
template <SizeT N> template <SizeT N>
template <SizeT N1> template <SizeT N1>
constexpr auto SPos<N>::operator-(const SPos<N1>& a) const constexpr decltype(auto) SPos<N>::operator-(const SPos<N1>& a) const
{ {
return SPos<N-N1>(); return SPos<N-N1>();
} }
template <SizeT N> template <SizeT N>
template <SizeT N1> template <SizeT N1>
constexpr auto SPos<N>::operator*(const SPos<N1>& a) const constexpr decltype(auto) SPos<N>::operator*(const SPos<N1>& a) const
{ {
return SPos<N*N1>(); return SPos<N*N1>();
} }
template <SizeT N> template <SizeT N>
template <SizeT N1> template <SizeT N1>
constexpr auto SPos<N>::operator()(const SPos<N1>& a) const constexpr decltype(auto) SPos<N>::operator()(const SPos<N1>& a) const
{ {
return SPos<N*N1>(); return SPos<N*N1>();
} }
template <SizeT N> template <SizeT N>
constexpr auto SPos<N>::operator+(const UPos& a) const constexpr decltype(auto) SPos<N>::operator+(const UPos& a) const
{ {
return UPos(N+a.val()); return UPos(N+a.val());
} }
template <SizeT N> template <SizeT N>
constexpr auto SPos<N>::operator*(const UPos& a) const constexpr decltype(auto) SPos<N>::operator*(const UPos& a) const
{ {
if constexpr(N == 0){ if constexpr(N == 0){
return SPos<0>(); return SPos<0>();
@ -80,7 +80,7 @@ namespace CNORXZ
} }
template <SizeT N> template <SizeT N>
constexpr auto SPos<N>::operator()(const UPos& a) const constexpr decltype(auto) SPos<N>::operator()(const UPos& a) const
{ {
if constexpr(N == 0){ if constexpr(N == 0){
return SPos<0>(); return SPos<0>();
@ -187,8 +187,8 @@ namespace CNORXZ
| FPos | | FPos |
+==========*/ +==========*/
inline FPos::FPos(SizeT ext, const SizeT* map, SizeT max, SizeT max2) : inline FPos::FPos(SizeT ext, const SizeT* map, SizeT max) :
mExt(ext), mMap(map), mMax(max), mMax2(max2) {} mExt(ext), mMap(map), mMax(max) {}
constexpr SizeT FPos::size() const constexpr SizeT FPos::size() const
{ {

View file

@ -29,17 +29,17 @@ namespace CNORXZ
constexpr SizeT val() const; constexpr SizeT val() const;
template <SizeT N1> template <SizeT N1>
constexpr auto operator+(const SPos<N1>& a) const; constexpr decltype(auto) operator+(const SPos<N1>& a) const;
template <SizeT N1> template <SizeT N1>
constexpr auto operator-(const SPos<N1>& a) const; constexpr decltype(auto) operator-(const SPos<N1>& a) const;
template <SizeT N1> template <SizeT N1>
constexpr auto operator*(const SPos<N1>& a) const; constexpr decltype(auto) operator*(const SPos<N1>& a) const;
template <SizeT N1> template <SizeT N1>
constexpr auto operator()(const SPos<N1>& a) const; constexpr decltype(auto) operator()(const SPos<N1>& a) const;
constexpr auto operator+(const UPos& a) const; constexpr decltype(auto) operator+(const UPos& a) const;
constexpr auto operator*(const UPos& a) const; constexpr decltype(auto) operator*(const UPos& a) const;
constexpr auto operator()(const UPos& a) const; constexpr decltype(auto) operator()(const UPos& a) const;
template <class PosT> template <class PosT>
constexpr decltype(auto) extend(const PosT& a) const; constexpr decltype(auto) extend(const PosT& a) const;
@ -94,12 +94,11 @@ namespace CNORXZ
SizeT mExt = 0; SizeT mExt = 0;
const SizeT* mMap = nullptr; const SizeT* mMap = nullptr;
SizeT mMax = 0; SizeT mMax = 0;
SizeT mMax2 = 0; // !!!!
public: public:
DEFAULT_MEMBERS(FPos); DEFAULT_MEMBERS(FPos);
inline FPos(SizeT ext, const SizeT* map, SizeT max = 0, SizeT max2 = 0); inline FPos(SizeT ext, const SizeT* map, SizeT max = 0);
constexpr SizeT size() const; constexpr SizeT size() const;
constexpr const SizeT& val() const; constexpr const SizeT& val() const;
@ -122,7 +121,6 @@ namespace CNORXZ
explicit constexpr operator SizeT() const; explicit constexpr operator SizeT() const;
constexpr SizeT max() const; constexpr SizeT max() const;
constexpr SizeT max2() const { return mMax2; }
constexpr const SizeT* map() const { return mMap; } constexpr const SizeT* map() const { return mMap; }
}; };