Iterators and Ranges: Comparing C++ to D to Rust
IGotD-
nise at nise.com
Mon Jun 14 12:33:37 UTC 2021
On Monday, 14 June 2021 at 01:48:18 UTC, Friendly Neighborhood
Weirdo wrote:
> This is a talk from the 2021 c++now conference:
> https://www.youtube.com/watch?v=d3qY4dZ2r4w
Interesting video. There is something that I'm kind of confused
about. The narrator in the video claims that in D popFront
doesn't consume the element. Is this true? When I do a popFront,
doesn't it consume the first element in an array for example. Can
someone clarify this?
Also in Rust, next does consume the element. However, in Rust you
can iterate over references (which also automatically borrows).
So iterating over borrowed references does not consume the
underlying data structure.
More information about the Digitalmars-d
mailing list