Created
January 11, 2017 13:26
-
-
Save picanumber/083a2ab0f64725e06c2832cd8dff0b21 to your computer and use it in GitHub Desktop.
Provides sorting with tie breakers
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, std::size_t... Is, class F> | |
void multi_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 detail::use_comparator<I, Is...>::apply( | |
_ts, lhs, rhs, forward<F>(bop)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment