Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for extra linked list methods #27794
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
|
This is basically a lame version of cursors, which is what we should use instead imo. It's not 1:1 though -- this api lets you have all the elements yielded at once. Classic iterator tradeoff. |
This comment has been minimized.
This comment has been minimized.
|
Triage: these are still unstable. |
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
dtolnay
referenced this issue
Nov 16, 2017
Closed
LinkedList API doesn't have enough support for removing and inserting elements #39148
This comment has been minimized.
This comment has been minimized.
|
There are some ideas for a more complete |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I'm going to echo @Gankro's thoughts:
An iterator conceptually represents a (double-ended) range of elements. The only operation that it supports is popping an element off the end of that range. A cursor on the other hand represents a position in a collection, and can be moved backwards or forwards in the collection. The cursor can be used to insert or remove an element at any given position in the collection. I strongly oppose adding insertion/deleting methods to As I mentioned in the linked thread, a design based on the |
alexcrichton commentedAug 13, 2015
This is a tracking issue for the unstable
linked_list_extrasmethods in the standard library.cc @Gankro, perhaps you can fill this in some more? The specific methods in question are:
IterMut::insert_nextIterMut::peek_next