https://issues.dlang.org/show_bug.cgi?id=13159
Orvid King <blah38...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blah38...@gmail.com --- Comment #1 from Orvid King <blah38...@gmail.com> --- Assuming that infos has a length property, it would be better yet to simply do: auto infos = getAddressInfo(hostname, service); auto results = new Address[infos.length]; Which would result in exactly the amount of memory needed being allocated, and only 1 allocation being done. I would also suggest the possibility of adding an OutputRange based version. --