Tuple literal syntax
Simen kjaeraas
simen.kjaras at gmail.com
Sun Oct 10 07:43:26 PDT 2010
bearophile <bearophileHUGS at lycos.com> wrote:
> Simen kjaeraas:
>
>> Perhaps it would be possible to augment struct static initializers for
>> this purpose?
>>
>> { int a; string b } foo( ) {
>> return { 1, "text" };
>> }
>
> What kind of tuple unpacking syntax do you suggest for this? (I think at
> the moment the unpacking syntax is more important than the literals one).
int a;
string b;
{ a, b } = foo( );
string s = "123456"
char c;
{ c, s... } = s;
I guess.
--
Simen
More information about the Digitalmars-d
mailing list