Is there anyway to remove the boilerplate code of dealing with tuples:

I find myself having to write things like this fairly often

auto someRandomName = f(...); //where f returns a tuple with two parts
auto firstPart = someRandomName[0];
auto secondPart = someRandomName[1];


Is to possible to write something so that the above is essentially equivalent to:

assignTuple!(firstPart,secondPart) = f(...);

The closest I can produce is using a template mixin so that I would have to write:

mixin AssignTuple!(()=>f(...),"firstPart","secondPart");

Reply via email to