From fe21b0bb8b75015c1caf9cd23fa35b68e35aedbd Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 31 Dec 2024 14:07:27 +0100 Subject: [PATCH] cleanup --- libsrc/meshing/meshtype.hpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 757073af..0f2e780d 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -206,8 +206,8 @@ namespace netgen TIndex operator++ (int) { TIndex hi{*this}; i++; return hi; } TIndex operator-- (int) { TIndex hi(*this); i--; return hi; } - TIndex operator++ () { i++; return TIndex{*this}; } - TIndex operator-- () { i--; return TIndex{*this}; } + TIndex & operator++ () { i++; return static_cast(*this); } + TIndex & operator-- () { i--; return static_cast(*this); } constexpr TIndex operator+= (T add) { i += add; return TIndex{*this}; } void Invalidate() { i = long(TIndex::BASE)-1; } bool IsValid() const { return i+1 != TIndex::BASE; } @@ -218,9 +218,7 @@ namespace netgen template - // constexpr auto operator+ (Index ind, int i) { return TIndex(T(ind)+i); } - // constexpr auto operator+ (Index ind, int i) { return TIndex{ Index(ind) +=i }; } - constexpr auto operator+ (Index ind, int i) { return ind += i; return TIndex(ind); } + constexpr auto operator+ (Index ind, int i) { return TIndex(ind.i+i); } template constexpr TIndex operator+ (Index pi, size_t i) { return TIndex(pi.i+i); } template @@ -250,7 +248,6 @@ namespace netgen { public: using Index::Index; - constexpr PointIndex (Index & ind) : Index(ind) { } }; } @@ -447,11 +444,6 @@ namespace netgen { public: using Index::Index; - /* - constexpr ElementIndex () = default; - constexpr ElementIndex (int i) : Index(i) { } - constexpr ElementIndex (Index & ind) : Index(ind) { } - */ }; inline istream & operator>> (istream & ist, ElementIndex & pi) @@ -477,7 +469,6 @@ namespace netgen { public: using Index::Index; - constexpr SurfaceElementIndex (Index & ind) : Index(ind) { } };