-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Views, sort_copy, online algorithms... #42
Comments
Currently, cpp-sort only offers an in-place sorting interface. There are plans to work on a sort_copy interface, but not right now (issue #42), hence I removed everything related to ska_sort_copy. The fallback of ska_sort was change to pdq_sort instead of std::sort to offer a better fallback algorithm, and to ensure that proxy iterators work as expected with ska_sort.
For cppsort::ska_sort.copy(collection, std::back_inserter(res)); I don't know whether it's a good idea. Like everything else I will have to balance the pros and cons. |
What I called a sorted "view" in the original post can't be a |
A few updates regarding the concerns discussed in this issue:
The other points are still very much open design issues without obvious answers to this day. To keep the genericity of the collection/compare/projection design without getting too complicated, I'd probably need to invent a way to give a separate channel for output range parameters somehow. |
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:
cppsort::sort_copy
function in the library taking a sorter (or defaulting todefault_sorter
) and an additionalOutputIterator
parameter?cppsort::sort_move
function?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
?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.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
The text was updated successfully, but these errors were encountered: