From 3086bf54ab7feb7a3ab4ec4f45ee8fcf1c8d105a Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Wed, 10 Jul 2024 14:39:04 +0200 Subject: [PATCH] minor changes --- src/include/xpr/pos_type.cc.h | 20 ++++++++++---------- src/include/xpr/pos_type.h | 26 ++++++++++++-------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/include/xpr/pos_type.cc.h b/src/include/xpr/pos_type.cc.h index bd5ec9c..b27e0c6 100644 --- a/src/include/xpr/pos_type.cc.h +++ b/src/include/xpr/pos_type.cc.h @@ -17,7 +17,7 @@ namespace CNORXZ { - + /*==========+ | SPos | +==========*/ @@ -36,40 +36,40 @@ namespace CNORXZ template template - constexpr auto SPos::operator+(const SPos& a) const + constexpr decltype(auto) SPos::operator+(const SPos& a) const { return SPos(); } template template - constexpr auto SPos::operator-(const SPos& a) const + constexpr decltype(auto) SPos::operator-(const SPos& a) const { return SPos(); } template template - constexpr auto SPos::operator*(const SPos& a) const + constexpr decltype(auto) SPos::operator*(const SPos& a) const { return SPos(); } template template - constexpr auto SPos::operator()(const SPos& a) const + constexpr decltype(auto) SPos::operator()(const SPos& a) const { return SPos(); } template - constexpr auto SPos::operator+(const UPos& a) const + constexpr decltype(auto) SPos::operator+(const UPos& a) const { return UPos(N+a.val()); } template - constexpr auto SPos::operator*(const UPos& a) const + constexpr decltype(auto) SPos::operator*(const UPos& a) const { if constexpr(N == 0){ return SPos<0>(); @@ -80,7 +80,7 @@ namespace CNORXZ } template - constexpr auto SPos::operator()(const UPos& a) const + constexpr decltype(auto) SPos::operator()(const UPos& a) const { if constexpr(N == 0){ return SPos<0>(); @@ -187,8 +187,8 @@ namespace CNORXZ | FPos | +==========*/ - inline FPos::FPos(SizeT ext, const SizeT* map, SizeT max, SizeT max2) : - mExt(ext), mMap(map), mMax(max), mMax2(max2) {} + inline FPos::FPos(SizeT ext, const SizeT* map, SizeT max) : + mExt(ext), mMap(map), mMax(max) {} constexpr SizeT FPos::size() const { diff --git a/src/include/xpr/pos_type.h b/src/include/xpr/pos_type.h index bf73c06..b3b3368 100644 --- a/src/include/xpr/pos_type.h +++ b/src/include/xpr/pos_type.h @@ -24,33 +24,33 @@ namespace CNORXZ constexpr SPos() = default; constexpr SPos(const SPos& a) = default; constexpr SPos(SPos&& a) = default; - + constexpr SizeT size() const; constexpr SizeT val() const; template - constexpr auto operator+(const SPos& a) const; + constexpr decltype(auto) operator+(const SPos& a) const; template - constexpr auto operator-(const SPos& a) const; + constexpr decltype(auto) operator-(const SPos& a) const; template - constexpr auto operator*(const SPos& a) const; + constexpr decltype(auto) operator*(const SPos& a) const; template - constexpr auto operator()(const SPos& a) const; - - constexpr auto operator+(const UPos& a) const; - constexpr auto operator*(const UPos& a) const; - constexpr auto operator()(const UPos& a) const; + constexpr decltype(auto) operator()(const SPos& a) const; + constexpr decltype(auto) operator+(const UPos& a) const; + constexpr decltype(auto) operator*(const UPos& a) const; + constexpr decltype(auto) operator()(const UPos& a) const; + template constexpr decltype(auto) extend(const PosT& a) const; - + template constexpr decltype(auto) operator<<(const PosT& a) const; explicit constexpr operator UPos() const; explicit constexpr operator SizeT() const; }; - + class UPos { private: @@ -94,12 +94,11 @@ namespace CNORXZ SizeT mExt = 0; const SizeT* mMap = nullptr; SizeT mMax = 0; - SizeT mMax2 = 0; // !!!! public: 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 const SizeT& val() const; @@ -122,7 +121,6 @@ namespace CNORXZ explicit constexpr operator SizeT() const; constexpr SizeT max() const; - constexpr SizeT max2() const { return mMax2; } constexpr const SizeT* map() const { return mMap; } };