Write variable from other function

Dicebot public at dicebot.lv
Fri Feb 28 10:56:09 PST 2014


On Friday, 28 February 2014 at 18:18:15 UTC, Suliman wrote:
> Probably not very good idea from me, I understand that I was 
> wrong thinking!

In case you really-really-really want it, such behavior can be 
achieved via std.typecons.Tuple :

import std.typecons;

auto foo()
{
     return tuple(true, "text");
}

void main()
{
     auto ret_val = foo();
     assert(ret_val[1] == "text");
}



More information about the Digitalmars-d-learn mailing list