diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index da5aa339..757073af 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -161,7 +161,7 @@ namespace netgen static constexpr t_invalid INVALID{}; constexpr Index () = default; - constexpr Index (const Index&) = default; + constexpr Index (const Index& i2) = default; constexpr Index (Index &&) = default; Index & operator= (const Index&) = default; Index & operator= (Index&&) = default; @@ -202,14 +202,13 @@ namespace netgen explicit constexpr operator T& () { return i; } public: // constexpr operator TIndex() const { return TIndex(i); } - operator TIndex&() { return static_cast(*this); } + // operator TIndex&() { return static_cast(*this); } TIndex operator++ (int) { TIndex hi{*this}; i++; return hi; } TIndex operator-- (int) { TIndex hi(*this); i--; return hi; } - TIndex & operator++ () { i++; return *this; } - TIndex operator-- () { i--; return *this; } - constexpr TIndex & operator+= (T add) & { i += add; return *this; } - constexpr TIndex operator+= (T add) && { i += add; return TIndex{*this}; } + TIndex operator++ () { i++; return TIndex{*this}; } + TIndex operator-- () { i--; return TIndex{*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; } // operator bool() const { return IsValid(); } @@ -220,7 +219,8 @@ 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 TIndex{ Index(ind) +=i }; } + constexpr auto operator+ (Index ind, int i) { return ind += i; return TIndex(ind); } template constexpr TIndex operator+ (Index pi, size_t i) { return TIndex(pi.i+i); } template