C++ Logo

std-proposals

Advanced search

[std-proposals] bikeshedding lazy_counted_iterator name from p2406r5

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Wed, 1 Mar 2023 21:54:33 +0100
I read p2406r5 paper and I fully understand why we need
this type, but I have no idea why it's named "lazy" as it makes MORE
work than `counted_iterator`. Only difference is the skipped last increment.
If I would guess behavior solely on name I would expect that it avoids ANY
increment until it's unavoidable, like only when dereferenced
 (but that would be probaby hard to implement correct without
performance pitfalls).


Another thing is the teachability and recognizing the difference between
`lazy_counted_iterator` and `counted_iterator`, why should someone use
one over the other?

Probably the best name for me would be like:
```
counted_iterator_for_unbund //as one of main usages is unlimited ranges
counted_iterator_eager_limit //as we enforce limit more
counted_iterator_skip_end //describe what exactly it do
```
or something else like that.

Received on 2023-03-01 20:54:44