From 261f471436c7d390d2b1307f5f94e21ec25d4de0 Mon Sep 17 00:00:00 2001 From: Danilo Piparo <danilo.piparo@cern.ch> Date: Mon, 5 Nov 2018 22:05:50 +0100 Subject: [PATCH] [VecOps][ROOT-9771] Allow Any and All to work also with RVec<bool> --- math/vecops/inc/ROOT/RVec.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math/vecops/inc/ROOT/RVec.hxx b/math/vecops/inc/ROOT/RVec.hxx index 78097599db7..73d79be9a77 100644 --- a/math/vecops/inc/ROOT/RVec.hxx +++ b/math/vecops/inc/ROOT/RVec.hxx @@ -710,7 +710,7 @@ RVec<T> Filter(const RVec<T> &v, F &&f) template <typename T> auto Any(const RVec<T> &v) -> decltype(v[0] == true) { - for (auto &e : v) + for (auto &&e : v) if (e == true) return true; return false; @@ -720,7 +720,7 @@ auto Any(const RVec<T> &v) -> decltype(v[0] == true) template <typename T> auto All(const RVec<T> &v) -> decltype(v[0] == false) { - for (auto &e : v) + for (auto &&e : v) if (e == false) return false; return true; -- GitLab