On Tue, Jun 11, 2013 at 6:28 AM, Noam Yorav-Raphael <[email protected]> wrote:
> Hello,
>
> Would you mind going into detail about when you need iterators that mutate
> containers? I always think of iterators as having no side effects.
>
> I ask that because if somehow you can live with only external iterators,
> having one type of iterators instead of two seems to me like a great
> simplification of the language.
>
> Thanks,
> Noam

They provide a way to mutate the contents of any container. For a map,
they are likely to only to exist for mutating the values, not the
keys.

In C++ and D, mutable iterators/ranges are very commonly used and we
do have `&mut [T]` available already. Eventually iterators will be
able to make the slice concept generic across containers.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to