Little quiz
spir
denis.spir at gmail.com
Thu Mar 24 19:01:26 PDT 2011
On 03/25/2011 01:50 AM, bearophile wrote:
> A little quiz for people here: guess the output of this little D2 program (it compiles correctly and doesn't crash at run time, so it's a fair question):
>
>
> import std.typecons: tuple;
> import std.c.stdio: printf;
>
> auto foo() {
> printf("foo\n");
> return tuple(1, 2);
> }
>
> void main() {
> foreach (x; foo().tupleof)
> printf("%d\n", x);
> }
lol, would never haver guessed
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d-learn
mailing list