Eager dirEntries

bearophile bearophileHUGS at lycos.com
Mon Mar 21 18:22:37 PDT 2011


Jonathan M Davis:

> Yes. With dirEntries, you have to tell it the iteration type. It could be
> either a DirEntry or a string. As such, it fails the template constraint for
> array. It would probably be possible to extend array to work with it (with you
> giving it the iteration type as a template argument), but array would have to
> be reworked a bit for that to work.

Thank you for your answer and I see, you may mean to optionally give it the item type:

string[] entries = array!string(dirEntries(directory, SpanMode.shallow));

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list