What is the stance on partial initializers when declaring multiplevariables
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Jul 22 11:26:06 PDT 2011
On 7/22/11 12:32 PM, bearophile wrote:
> Two questions: is typed unpacking too supported?
> (int a1, float a2, auto a3) = sometuple;
The particular rule I suggested does not allow that.
> Is unpaking inside foreach too supposed to work? This is quite useful:
> auto somepairs = [tuple(1, "foo"), tuple(10, "bar")];
> foreach ((x, name); somepairs) {}
This is a bit risky as foreach (x, name; somepairs) would mean something
completely different.
Andrei
More information about the Digitalmars-d
mailing list