You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::collections::BinaryHeap has a bunch of unstable methods without proper stability markings; filing an issue to point them at. Someone please label this B-unstable.
It looks like the unstable methods are: from_vec, push_pop, replace, into_vec, into_sorted_vec and drain. Except for drain, is there any writing on why these methods were not stabilized? Were there any specific reservations about those methods?
I believe they weren't stabilized mostly because they didn't fit into any existing collections conventions and to be conservative we didn't add too much special functionality to collections around 1.0. They're pretty innocuous though, so I'd imagine they're ripe for some small modernization followed by stabilization.
from_vec and into_vec seem like super obvious and straightforward methods to stabilize as is.
push_pop and replace seems a bit weirder. What use cases are they targeting? What kind of performance improvements do you actually see using them vs replicating their behavior naively? C++ and Java don't have any equivalent functionality.
Activity
BurntSushi commentedon Sep 16, 2015
It looks like the unstable methods are:
from_vec
,push_pop
,replace
,into_vec
,into_sorted_vec
anddrain
. Except fordrain
, is there any writing on why these methods were not stabilized? Were there any specific reservations about those methods?alexcrichton commentedon Sep 17, 2015
I believe they weren't stabilized mostly because they didn't fit into any existing collections conventions and to be conservative we didn't add too much special functionality to collections around 1.0. They're pretty innocuous though, so I'd imagine they're ripe for some small modernization followed by stabilization.
sfackler commentedon Sep 17, 2015
from_vec
andinto_vec
seem like super obvious and straightforward methods to stabilize as is.push_pop
andreplace
seems a bit weirder. What use cases are they targeting? What kind of performance improvements do you actually see using them vs replicating their behavior naively? C++ and Java don't have any equivalent functionality.aturon commentedon Sep 23, 2015
Should replace
from_vec
with an impl of theFrom
trait.sfackler commentedon Sep 23, 2015
We should be careful to document the impl so that people can ctrl+f heapify and find it.
alexcrichton commentedon Sep 24, 2015
This issue is now entering its cycle-long FCP for stabilization in 1.5
The specific actions to be taken here will be:
from_vec
in favor ofFrom<Vec<T>> for BinaryHeap<T>
into_vec
as well as addInto<Vec<T>> for BinaryHeap<T>
intoto_sorted_vec
The
push_pop
andreplace
methods will have an FCP at a later time.BurntSushi commentedon Sep 24, 2015
I think we want
From<BinaryHeap<T>> for Vec<T>
instead? (I think this gives us theInto
impl automatically.)photino commentedon Oct 21, 2015
If we have already stabilized the
into_vec
method, are there any good reasons for addingInto<Vec<T>> for BinaryHeap<T>
with the same functionality?sfackler commentedon Oct 21, 2015
Into<Vec<T>>
can be used in generic contexts.43 remaining items