Skip to content

Commit

Permalink
Takes iterators by value, uses less<>
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhaining committed Apr 8, 2016
1 parent 8bf4004 commit 386c2b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sorted.hpp
Expand Up @@ -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<Container>& it1,
iterator_type<Container>& it2) {
[compare_func](iterator_type<Container> it1,
iterator_type<Container> it2) {
return compare_func(*it1, *it2);
});
}
Expand All @@ -69,8 +69,7 @@ iter::impl::SortedView<Container> iter::sorted(
namespace iter {
template <typename Container>
auto sorted(Container&& container) {
return sorted(std::forward<Container>(container),
std::less<impl::iterator_deref<Container>>());
return sorted(std::forward<Container>(container), std::less<>{});
}
}

Expand Down

0 comments on commit 386c2b3

Please sign in to comment.