Why splitter() doesn't work?

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 14 16:00:24 PDT 2012


On Sunday, October 14, 2012 22:09:43 Peter Alexander wrote:
> I wonder if a better design for splitter would automatically
> allocate an array when the input range doesn't support slicing?

We generally try and avoid any kind of allocation like that in std.algorithm. 
We leave it up to the programmer to do that. Otherwise, you'd end up with all 
kinds of invisible performance hits. And it's doubly bad for anyone trying to 
avoid using the GC.

- Jonathan M Davis


More information about the Digitalmars-d mailing list