File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -535,16 +535,26 @@ if (distinctFieldNames!(Specs))
535535 string injectNamedFields ()
536536 {
537537 string decl = " " ;
538- import std.conv : to;
539- static foreach (i, val; fieldSpecs)
540- {{
541- auto si = to ! string (i);
542- decl ~= " alias _" ~ si ~ " = Identity!(field[" ~ si ~ " ]);" ;
543- if (val. name.length != 0 )
538+ foreach (i, name; staticMap ! (extractName, fieldSpecs))
539+ {
540+ import std.format : format;
541+
542+ decl ~= format( " alias _%s = Identity!(field[%s ]);" , i, i) ;
543+ if (name.length != 0 )
544544 {
545- decl ~= " alias " ~ val.name ~ " = _" ~ si ~ " ; " ;
545+ decl ~= format( " alias %s = _%s; " , name, i) ;
546546 }
547- }}
547+ }
548+ // import std.conv : to;
549+ // static foreach (i, val; fieldSpecs)
550+ // {{
551+ // auto si = to!string(i);
552+ // decl ~= "alias _" ~ si ~ " = Identity!(field[" ~ si ~ "]);";
553+ // if (val.name.length != 0)
554+ // {
555+ // decl ~= "alias " ~ val.name ~ " = _" ~ si ~ ";";
556+ // }
557+ // }}
548558 return decl;
549559 }
550560
You can’t perform that action at this time.
0 commit comments