3 ms·
... but how's that different of what we have today ? std::sort(vec.begin(), vec.end(), [] (const auto& lhs, const auto& rhs) { return
by jcelerier 6y ago
... but how's that different of what we have today ?
std::sort(vec.begin(), vec.end(),
[] (const auto& lhs, const auto& rhs) {
return lhs.whatever < rhs.whatever;
});
or
auto sort_by_whatever = [] (const auto& lhs, const auto& rhs) {
return lhs.whatever < rhs.whatever;
};
std::sort(vec.begin(), vec.end(), sort_by_whatever);
- rightbyte 6y agoSorry was refering to C in that comment with no lambdas, with the GCC extension.