From 626507f8fb4cc4ff0b246eb6c17c78b5e06df417 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 31 Dec 2024 13:03:46 +0100 Subject: [PATCH] missing constexpr --- libsrc/meshing/meshtype.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 04921418..289d064a 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -204,12 +204,12 @@ namespace netgen constexpr operator TIndex() const { return TIndex(i); } constexpr 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-- (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 *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(); } @@ -230,7 +230,7 @@ namespace netgen template constexpr inline auto operator- (Index pi, int i) -> TIndex { return TIndex(pi.i-i); } template - inline int operator- (Index pa, Index pb) { return pa.i-pb.i; } + constexpr inline int operator- (Index pa, Index pb) { return pa.i-pb.i; } template inline bool operator< (Index a, Index b) { return a.i-b.i < 0; } template