Skip to content

Commit 386c2b3

Browse files
committed
Takes iterators by value, uses less<>
1 parent 8bf4004 commit 386c2b3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sorted.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class iter::impl::SortedView {
4242

4343
// sort by comparing the elements that the iterators point to
4444
std::sort(std::begin(sorted_iters.get()), std::end(sorted_iters.get()),
45-
[compare_func](iterator_type<Container>& it1,
46-
iterator_type<Container>& it2) {
45+
[compare_func](iterator_type<Container> it1,
46+
iterator_type<Container> it2) {
4747
return compare_func(*it1, *it2);
4848
});
4949
}
@@ -69,8 +69,7 @@ iter::impl::SortedView<Container> iter::sorted(
6969
namespace iter {
7070
template <typename Container>
7171
auto sorted(Container&& container) {
72-
return sorted(std::forward<Container>(container),
73-
std::less<impl::iterator_deref<Container>>());
72+
return sorted(std::forward<Container>(container), std::less<>{});
7473
}
7574
}
7675

0 commit comments

Comments
 (0)