From a7d5856385f126e874db6010d9dbfd37290c61de Mon Sep 17 00:00:00 2001 From: Yatao Li Date: Mon, 6 Aug 2018 18:53:13 +0800 Subject: fix #390 --- Ix/CPP/src/cpplinq/linq.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ix/CPP/src/cpplinq/linq.hpp b/Ix/CPP/src/cpplinq/linq.hpp index be77151..6552f79 100644 --- a/Ix/CPP/src/cpplinq/linq.hpp +++ b/Ix/CPP/src/cpplinq/linq.hpp @@ -471,22 +471,22 @@ public: // TODO: skip_while(pred) - template + template typename std::enable_if::value, ITEM>::type sum() const { ITEM seed{}; return sum(seed); } - typename element_type sum(typename element_type seed) const { + element_type sum(element_type seed) const { return std::accumulate(begin(), end(), seed); } - template ::type> + template ::type> typename std::enable_if::value, Result>::type sum(Selector sel) const { return from(begin(), end()).select(sel).sum(); } - template ::type> + template ::type> Result sum(Selector sel, Result seed) const { return from(begin(), end()).select(sel).sum(seed); } -- cgit v1.2.3