Few questions about staticMap

Mitacha mateusz.mitaszka at gmail.com
Tue Feb 26 18:50:39 UTC 2019


Hi everyone,

I checked, just out of curiosity, what is staticMap's 
implementation. It's implemented using recursive, this made me 
think if there is way to use static foreach instead. I came out 
with following solution: https://run.dlang.io/is/qvgJaw

I checked time it took compiler to compile std and my version for 
7 parameters and there was no difference. The only difference I 
found was number of template instantiations: 1 for my code and 9 
for std version.

Are there any benefits to implementing staticMap use recursive 
template?


More information about the Digitalmars-d-learn mailing list