Closed grovesNL closed 1 day ago
The tree doesn't actually know the bounds of an element, just an upper bound. Would you want that?
The bounds would be useful to be able to queue (after traversal) some elements for removal based on their values, so I guess the upper bound would work for that, right?
Ah, that makes sense, yeah.
Counterpoint: why not fetch the bound from the T
, as you're generally presumed to be able to do efficiently?
Yeah that sounds good, so the iterator could either return usize
(look up the &T
with get
) or (usize, &T)
pairs
Probably (usize, &T)
, so that the iter_mut
variant can yield a &mut T
while the iterator is live.
Implemented naively in 3d1bc7a31a737abec88eb30eb625de92fbc59153.
This probably shouldn't be used often, but in some cases (even just external tests) it would be useful to have something like a entire tree iterator to iterate over all
(id, bounds)
pairs.