[Sharing]Tuple to variables (My Function)

MattCoder mattcoder at hotmail.com
Fri Jun 14 18:00:52 PDT 2013


On Saturday, 15 June 2013 at 00:47:01 UTC, bearophile wrote:
> You have to verify in the function constraint that the lengths 
> match.

In fact that was intentional, because sometimes I just want few 
items from a tuple not all.

For example:

auto RGB = tuple(255, 125, 50);
Variant r,g;
tupleToVar(RGB, r, g); // I just want the red and green values 
from a tuple

Matheus.


More information about the Digitalmars-d-learn mailing list