Created
January 11, 2017 11:58
-
-
Save picanumber/c713eb288812ba13452f47cde54d0e6b to your computer and use it in GitHub Desktop.
The sort member function of sorted_view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <std::size_t I, class F> | |
void sort(F&& bop) const | |
{ | |
using namespace std; | |
_is.resize(get<I>(_ts).size()); | |
iota(begin(_is), end(_is), 0); | |
std::sort(begin(_is), end(_is), [&](size_t lhs, size_t rhs) { | |
return forward<F>(bop)(get<I>(_ts)[lhs], get<I>(_ts)[rhs]); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment