Re: Algorithms and slices

2011-08-26 Thread Jonathan M Davis
On Friday, August 26, 2011 11:49 Timon Gehr wrote: > On 08/26/2011 08:24 PM, Mafi wrote: > > The algorithms in std.algorithm are great. They operate the same on > > arrays/slices and generic ranges. But they return their own range-types. > > Often this ok but sometimes you need a T[]. You may say t

Re: Algorithms and slices

2011-08-26 Thread Ali Çehreli
On Fri, 26 Aug 2011 20:24:43 +0200, Mafi wrote: > The algorithms in std.algorithm are great. They operate the same on > arrays/slices and generic ranges. But they return their own range-types. > Often this ok but sometimes you need a T[]. I have a feeling that std.range.inputRangeObject() will be

Re: Algorithms and slices

2011-08-26 Thread Dmitry Olshansky
On 26.08.2011 22:24, Mafi wrote: The algorithms in std.algorithm are great. They operate the same on arrays/slices and generic ranges. But they return their own range-types. Often this ok but sometimes you need a T[]. You may say to just use array() but this allocates a new array! I think you som

Re: Algorithms and slices

2011-08-26 Thread Timon Gehr
On 08/26/2011 08:24 PM, Mafi wrote: The algorithms in std.algorithm are great. They operate the same on arrays/slices and generic ranges. But they return their own range-types. Often this ok but sometimes you need a T[]. You may say to just use array() but this allocates a new array! I think you

Algorithms and slices

2011-08-26 Thread Mafi
The algorithms in std.algorithm are great. They operate the same on arrays/slices and generic ranges. But they return their own range-types. Often this ok but sometimes you need a T[]. You may say to just use array() but this allocates a new array! I think you sometimes want to get a slice to