Skip to content

External iterators for TreeMap and TreeSet #8354

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

Closed
wants to merge 4 commits into from
Closed

External iterators for TreeMap and TreeSet #8354

wants to merge 4 commits into from

Conversation

bluss
Copy link
Member

@bluss bluss commented Aug 6, 2013

Root out the last of all each_* methods and the set operation methods (except mutate_values that does live on).

Implement a gang of iterators for difference, sym difference, intersection, union of two sets. Also implement .rev_iter() for the map and the set.

blake2-ppc added 4 commits August 6, 2013 23:20
Write the Eq and Ord impls for TreeMap in a more straightforward way
using iterator::Zip
Write external iterators for Difference, Sym. Difference, Intersection
and Union set operations.

These iterators are generic insofar that they could work on any ordered
sequence iterators, even though they are type specialized to the
TreeSetIterator in this case.

Looking at the `check` function in the treeset tests, rustc seems
unwilling to compile a function resembling::

    fn check<'a, T: Iterator<&'a int>>(... )

so the tests for these iterators are still running the legacy loop
protocol.
Implement reverse iterators for TreeMap and TreeSet, that produce the
keys in backward order.
.each_key(), .each_value() and the other methods are replaced by .iter()
and .rev_iter(), and restrictions of those iterators.
@emberian
Copy link
Member

emberian commented Aug 8, 2013

Closing; in my rollup.

@emberian emberian closed this Aug 8, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 10, 2022
Update docs for `map_flatten` on `Option` case

closes rust-lang#8345

changelog: [`map_flatten`] Add docs info for `Option` case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants