Remove unnecessary includes, add const

This commit is contained in:
Peter Dimov 2020-06-06 21:49:09 +03:00
parent e155e13084
commit 544fd495e5

View File

@ -8,16 +8,14 @@
// http://www.boost.org/LICENSE_1_0.txt // http://www.boost.org/LICENSE_1_0.txt
// //
#include <cmath>
#include <functional>
#include <vector>
#include <boost/core/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cmath>
template <typename T> template <typename T>
struct with_tolerance struct with_tolerance
{ {
with_tolerance(T tolerance) : tolerance(tolerance) {} with_tolerance(T tolerance) : tolerance(tolerance) {}
bool operator()(T lhs, T rhs) bool operator()(T lhs, T rhs) const
{ {
return (std::abs(lhs - rhs) <= tolerance); return (std::abs(lhs - rhs) <= tolerance);
} }