diff --git a/functools.hpp b/functools.hpp index c82214b..0843024 100644 --- a/functools.hpp +++ b/functools.hpp @@ -44,21 +44,21 @@ namespace sc { // iterator versions template - std::vector map(FwdIter& begin, FwdIter& end, std::function fun) { + std::vector map(FwdIter begin, FwdIter end, std::function fun) { std::vector result; std::transform(begin, end, std::back_inserter(result), fun); return result; } template - std::vector filter(FwdIter& begin, FwdIter& end, std::function fun) { + std::vector filter(FwdIter begin, FwdIter end, std::function fun) { std::vector result; std::copy_if(begin, end, std::back_inserter(result), fun); return result; } template - R reduce(FwdIter& begin, FwdIter& end, R seed, std::function fun) { + R reduce(FwdIter begin, FwdIter end, R seed, std::function fun) { R result {seed}; for (FwdIter it = begin; it != end; ++it) { result = fun(*it, result);