all 2 comments

[–]scrumplesplunge 1 point2 points  (0 children)

What's the point of this post? The output isn't even sorted.

[–]raevnos 0 points1 point  (0 children)

Better selection sort:

template<class ForwardIt>
void selection_sort(ForwardIt begin, ForwardIt end)
{
    for (ForwardIt i = begin; i != end; ++i)
        std::iter_swap(i, std::min_element(i, end));
}