how convert the range to slice ?

data man via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 28 06:54:26 PST 2015


On Wednesday, 28 January 2015 at 14:32:38 UTC, mzfhhhh wrote:
> is there any simple way to convert?
>
> int [] arr1 = [1,2,3].map!"a*2";   //compile error
> int [] arr2 = [1,2,3].filter!"a<3";//compile error

auto arr1 = [1,2,3].map!"a*2".array;
auto arr2 = [1,2,3].filter!"a<3".array;


More information about the Digitalmars-d-learn mailing list