dsimcha Wrote:

> == Quote from Andrei Alexandrescu ([email protected])'s article

> > The idea is very simple: just use D's native append operation, but cache
> > the capacity to avoid too many lookups (I understand that that's the
> > bottleneck).
> > I paste the code below, I'd be indebted if you guys grabbed it and
> > tested it.
> > Andrei
> > struct ArrayAppender(T)
> > {
> >      size_t capacity() const { return _capacity; }
> >      void putNext(T item)

I have thoughts:

1) There should probably be a length/size call
2) How about add() or append() for a shorter name
3) What about using ~=?  Maybe this is too short...

Jerry

Reply via email to