Make std.container.Array an output range

Rene Zwanenburg via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 5 06:51:34 PDT 2014


I depend heavily on RAII in a project I'm working on. Since 
structs in dynamic arrays never have their destructors called I'm 
using Array!T instead. A pattern that comes up often is that I 
have some input range of T's which need to be stored in a member 
Array!T. However Array is not an output range so I can't use

inputRange.copy(someArray);

I understand the difference between a container and a range 
iterating over that container. However I do think a container is 
an output range.

Should I file an enhancement request or is there something 
fundamentally wrong with this idea? For Array it should be as 
simple as adding

alias doPut = insertBack;


More information about the Digitalmars-d mailing list