From 386c2b31016568a33b32559e80082bb07d2a37cc Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Fri, 8 Apr 2016 10:16:50 -0700 Subject: [PATCH] Takes iterators by value, uses less<> --- sorted.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sorted.hpp b/sorted.hpp index b9a03560..3fc4767d 100644 --- a/sorted.hpp +++ b/sorted.hpp @@ -42,8 +42,8 @@ class iter::impl::SortedView { // sort by comparing the elements that the iterators point to std::sort(std::begin(sorted_iters.get()), std::end(sorted_iters.get()), - [compare_func](iterator_type& it1, - iterator_type& it2) { + [compare_func](iterator_type it1, + iterator_type it2) { return compare_func(*it1, *it2); }); } @@ -69,8 +69,7 @@ iter::impl::SortedView iter::sorted( namespace iter { template auto sorted(Container&& container) { - return sorted(std::forward(container), - std::less>()); + return sorted(std::forward(container), std::less<>{}); } }