diff --git a/src/OpenMesh/Core/Mesh/SmartRange.hh b/src/OpenMesh/Core/Mesh/SmartRange.hh index affaeb71..b87a8bea 100644 --- a/src/OpenMesh/Core/Mesh/SmartRange.hh +++ b/src/OpenMesh/Core/Mesh/SmartRange.hh @@ -78,13 +78,13 @@ struct SmartRangeT * @param f Functor that is applied to all elements before computing the sum */ template - auto sum(Functor&& f) -> decltype (f(std::declval())) + auto sum(Functor&& f) -> typename std::decay()))>::type { auto range = static_cast(this); auto begin = range->begin(); auto end = range->end(); assert(begin != end); - decltype (f(*begin)) sum = f(*begin); + typename std::decay::type sum = f(*begin); auto it = begin; ++it; for (; it != end; ++it) @@ -99,13 +99,13 @@ struct SmartRangeT * @param f Functor that is applied to all elements before computing the average. */ template - auto avg(Functor&& f) -> decltype (f(std::declval())) + auto avg(Functor&& f) -> typename std::decay()))>::type { auto range = static_cast(this); auto begin = range->begin(); auto end = range->end(); assert(begin != end); - decltype (f(*begin)) sum = f(*begin); + typename std::decay::type sum = f(*begin); auto it = begin; ++it; int n_elements = 1;