Simultaneously assigning to all values in a tuple

Paul Backus snarwin at gmail.com
Sat Mar 30 17:18:46 UTC 2019


On 3/27/19 8:29 PM, Jamie wrote:
> Is it possible to assign to all values in a tuple at once if they are
> the same type?
> I.e.
> 
> Tuple!(double, "x", double, "y") t;
> t[] = 1.0;
> 

foreach (ref member; t.expand) {
    member = 1.0;
}


More information about the Digitalmars-d-learn mailing list