Control Structures Proposal
Reiner Pope
some at address.com
Wed Jul 25 23:20:58 PDT 2007
Reiner Pope wrote:
> void main()
> {
> alias Tuple!(int, double) T;
> T t;
> t[0] = 5;
> t[1] = 15.0;
>
> mixin(Foreach( "x", "t", `x *= 3;` ));
>
> writefln("%s %s", t); // prints 15 45
> }
> (implementation attached)
>
I forgot to attach the implementation I promised. oops.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tupleforeach.d
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070726/1068eb97/attachment.ksh>
More information about the Digitalmars-d
mailing list