What's equivalent to C#'s select?
Simen Kjærås
simen.kjaras at gmail.com
Mon Jan 15 15:29:56 UTC 2018
On Monday, 15 January 2018 at 15:24:50 UTC, Marc wrote:
> I just thought that filter() could be evaluated at compile time
> too, as others function that I've used so far. Sometimes I
> don't know if a native function can be evaluated at compile
> time until I do enum x = func();
Yeah, it takes some getting used to what happens when and how
these interact. I can recommend H. S. Teoh's writeup:
https://wiki.dlang.org/User:Quickfur/Compile-time_vs._compile-time
> if I want to have minimum runtime code to filter out immutable
> strings, the first one is better right?
Indeed. It generates the equivalent code to just writing the
writeln()s you want, with no run-time overhead.
--
Simen
More information about the Digitalmars-d-learn
mailing list