Named arguments via struct initialization in functions
Edwin van Leeuwen via Digitalmars-d
digitalmars-d at puremagic.com
Tue Mar 8 23:32:43 PST 2016
On Wednesday, 9 March 2016 at 07:30:31 UTC, Edwin van Leeuwen
wrote:
> I also added a merge function that will return a tuple
> containing merged named tuples:
>
> Tuple!(double,"x",string,"colour")(-1,
> "black").merge(Tuple!(double,"x")(0.0))
>
> returns:
> Tuple!(double,"x",string,"colour")(0, "black");
Quick clarification. The merge function is used to merge the
passed tuple, with the default values needed in the function.
This way we don't have to worry about missing values.
More information about the Digitalmars-d
mailing list