Steve Schveighoffer wrote:
This is a good idea. I still think a function to do this should be
available, so you can do the allocation in one step instead of
declaring an array and then setting its capacity.
What about the issue of shrinking the allocated size as in the loop I
showed? Should this be allowed via builtin arrays or reserved to a
wrapper?
I think regardless of what we do, there will be people who will say
buffer.length = 0 if they want to reuse a buffer. I think we should do
something sensible in such cases. The case I don't think we want to
endorse as an idiom is "for efficiency, initialize needlessly a large
buffer and then assign its length to zero".
Andrei
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos