[Question] Could a function return a list of arguments to call another function?

MattCoder mattcoder at hotmail.com
Fri Jun 28 13:01:33 PDT 2013


On Friday, 28 June 2013 at 19:39:41 UTC, Ellery Newcomer wrote:
> However, they can return std.typecons.Tuple, so you could do 
> this:
>
> auto foo(int i, int j) {
>     writeln(i, " ", j);
>     return tuple(3,4);
> }
> void main() {
>     foo(foo(1,2).field);
> }


Hi Ellery,

Thanks for your help, it works nicely.


More information about the Digitalmars-d-learn mailing list