View source code
Display the source code in dmd/cond.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.

Function dmd.cond.StaticForeach.createTupleType

For a static foreach with multiple loop variables, the aggregate is lowered to an array of tuples. As D does not have built-in tuples, we need a suitable tuple type. This generates a struct that serves as the tuple type. This type is only used during CTFE and hence its typeinfo will not go to the object file.

TypeStruct createTupleType(
  Loc loc,
  dmd.root.array.Array!(dmd.expression.Expression)* e,
  dmd.dscope.Scope* sc
);

Parameters

NameDescription
loc The source location.
e The expressions we wish to store in the tuple.
sc The current scope.

Returns

A struct type of the form struct Tuple { typeof(AliasSeq!(e)) tuple; }

Authors

Walter Bright

License

Boost License 1.0