Right after allocators: containers or database connectivity?
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jun 9 16:38:58 PDT 2015
On Tuesday, 9 June 2015 at 22:37:32 UTC, Andrei Alexandrescu
wrote:
> On 6/9/15 3:11 PM, Jonathan M Davis wrote:
>> And containers are really the main place, I think, where
>> iterators
>> actually do better than ranges.
>
> I think iterators would need to add huge value to warrant
> addition. -- Andrei
I don't disagree. I think that we should stick with ranges. I
just think that this is one of the few areas where ranges are
actually worse than iterators, whereas in most other areas,
they're better. The result is that some of the idioms that are
used with iterators in C++ become increasingly unwieldy with
ranges - finding an element and removing it from the container is
probably the simplest example.
So, I think that the main change that we need to make in that
regard to std.container is to have more functions which operate
based on keys or values passed to the function rather than just
having range-based functions. So, we'd have functions like
removeFirst, removeLast, removeAll, etc. which take values rather
than having all of the container functions be range-based.
Iterators wouldn't need to enter into it at all.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list