Are there any differences between
template <typename ForwardIter,
typename Comp = std::less<typename std::iterator_traits<ForwardIter>::value_type>>
void select_sort(ForwardIter first, ForwardIter last, Comp comp = Comp())
{
for (; first != last; ++first)
{
auto iter = std::min_element(first, last, comp);
std::swap(*first, *iter);
}
}
and the simpler version
template <typename ForwardIter,
typename Comp = std::less<>>
void select_sort(ForwardIter first, ForwardIter last, Comp comp = Comp())
{
// Same as above
}
Both seem to work. Is it just a style issue? Or are the cases where one have to choose one or the other?