IIUC you have this using `ranges` (which itself needs concepts as implemented). With it you can even do :
for (int i : ints | std::views::filter(even) | std::views::transform(square)) {
std::cout << i << ' ';
}
notice the `for (int i:ints)` and the pipes filters.EDIT: more specifically, you can use sort on a range now (source : https://cppreference.com):
ranges::sort(s);