From b3bc325934ff412ff740d35c1984bcd987e1929c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Wed, 9 Nov 2016 20:57:23 +0100 Subject: [PATCH] Add integral `Threshold::operator ==(Threshold)` Kudos to @heckflosse for reminding me what C++11 is about. :) --- rtengine/procparams.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 3a7c3efbb..868a56540 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -229,6 +230,22 @@ public: && std::abs(value[1] - rhs.value[1]) < 1e-10; } } + + template::value>::type> + bool operator ==(const Threshold &rhs) const + { + if (_isDouble) { + return + value[0] == rhs.value[0] + && value[1] == rhs.value[1] + && value[2] == rhs.value[2] + && value[3] == rhs.value[3]; + } else { + return + value[0] == rhs.value[0] + && value[1] == rhs.value[1]; + } + } }; /**