summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/include/gudhi/distance_functions.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h
index 5891ef0e..7bf97c23 100644
--- a/src/common/include/gudhi/distance_functions.h
+++ b/src/common/include/gudhi/distance_functions.h
@@ -24,6 +24,8 @@
#define DISTANCE_FUNCTIONS_H_
#include <cmath> // for std::sqrt
+#include <type_traits> // for std::decay
+#include <iterator> // for std::begin, std::end
/** @file
* @brief Global distance functions
@@ -34,7 +36,7 @@
class Euclidean_distance {
public:
template< typename Point >
- auto operator()(const Point& p1, const Point& p2) -> typename std::decay<decltype(*std::begin(p1))>::type {
+ auto operator()(const Point& p1, const Point& p2) const -> typename std::decay<decltype(*std::begin(p1))>::type {
auto it1 = p1.begin();
auto it2 = p2.begin();
typename Point::value_type dist = 0.;