Add integral Threshold::operator ==(Threshold)
Kudos to @heckflosse for reminding me what C++11 is about. :)
This commit is contained in:
parent
4ee191487e
commit
b3bc325934
@ -22,6 +22,7 @@
|
||||
#include <vector>
|
||||
#include <cstdio>
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
#include <glibmm.h>
|
||||
#include <lcms2.h>
|
||||
@ -229,6 +230,22 @@ public:
|
||||
&& std::abs(value[1] - rhs.value[1]) < 1e-10;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename U = T, typename = typename std::enable_if<std::is_integral<U>::value>::type>
|
||||
bool operator ==(const Threshold<T> &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];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user