Is there a nicer way to get the first element or typeof(element).init from a range?

realhet real_het at hotmail.com
Sun May 30 12:21:46 UTC 2021


On Sunday, 30 May 2021 at 12:16:19 UTC, realhet wrote:

>    presets.keys.sort.take(1).get(0);   <-----

Oups: after fixing an error and making it compile the solution is 
even uglier:

presets.keys.sort.take(1).array.get(0);


More information about the Digitalmars-d-learn mailing list