std.algorithms filter and string[]

David Nadlinger see at klickverbot.at
Wed Apr 11 07:06:35 PDT 2012


On Wednesday, 11 April 2012 at 13:55:45 UTC, Russel Winder wrote:
> I am having a dumb n00b moment, but I need to solve this 10 
> mins ago ;-)
>
> 	immutable files = ( selector == 0 ) ? [ "." ] : filter ! ( ( 
> string x ) { return x.isFile ; } ) ( sliceOfStrings ) ;
>
> gives me the error:
> […]

filter() is lazy – just use array() for eager evaluation?

David


More information about the Digitalmars-d mailing list