Compile time performance for metaprogramming is somewhat inconsistent
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Thu Mar 3 04:30:31 PST 2016
On Thursday, 3 March 2016 at 02:03:01 UTC, maik klein wrote:
> Consider the following code
>
> void main()
> {
> import std.stdio;
> import std.range: iota, join;
> import std.algorithm.iteration: map;
> import std.conv: to;
> import std.meta: aliasSeqOf, staticMap, AliasSeq;
> enum types = "AliasSeq!(" ~ iota(0,10000).map!(i =>
> to!string(i)).join(",") ~ ")";
> alias t = AliasSeq! (mixin(types));
> //alias t1 = aliasSeqOf!(iota(0, 10000));
> }
>
> [...]
Templates are by default more work then mixins.
If you want me to I can elaborate on that.
More information about the Digitalmars-d
mailing list