Open
Description
cpp-sort currently only cares about in-place sorting algorithms: algorithms that mutate the passed collection and don't return anything (except when they do), which is pretty much enough for people most of the time. However, I believe that there is some value in having algorithms that actually copy a sorted equivalent of the passed collection into the library. It once again leads to maaaaany design decisions depending on how we want to implement that:
- Have a
cppsort::sort_copy
function in the library taking a sorter (or defaulting todefault_sorter
) and an additionalOutputIterator
parameter? - Provide an equivalent
cppsort::sort_move
function? - Create a
cppsort::sorted
function that takes an iterable and returns a new instance of the same iterable? Make it work with anOutputIterator
instead? Have it take any sorter likecppsort::sort
? - Add a
cppsort::sorted_view
returning a range with sorted iterators which, when iterated, corresponds to a sorted view of the original collection? It's pretty much whatindirect_adapter
does in the first place, but decoupling it from the adapter might also be interesting. - Have first-class support for online sorting algorithm? Adding an
is_online
property incppsort::sorter_traits
is easy, but how to use it properly?
An interesting algorithm about incremental sort that might provide some idea and/or insights about online/incremental sorting: http://larshagencpp.github.io/blog/2016/04/23/fast-incremental-sort