From a0921a5e7f8a5acefa9987cce0db63ae8bfb8f7c Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 28 Nov 2019 10:44:10 +0100 Subject: [PATCH] Fix Vec<> comparison operator - Iterate over size of Vec<> (thx Joachim) - Declare it const (otherwise pybind compares the pointers to the data arrays instead) --- libsrc/gprim/geomobjects.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsrc/gprim/geomobjects.hpp b/libsrc/gprim/geomobjects.hpp index dbdc7981..06f08262 100644 --- a/libsrc/gprim/geomobjects.hpp +++ b/libsrc/gprim/geomobjects.hpp @@ -120,9 +120,12 @@ namespace netgen return *this; } - bool operator== (const Vec &a) + bool operator== (const Vec &a) const { - return x[0]==a.x[0] && x[1]==a.x[1] && x[2]==a.x[2]; + bool res = true; + for (auto i : Range(D)) + res &= (x[i]==a.x[i]); + return res; } T & operator() (int i) { return x[i]; }