[phobos] Preferred style for multivalue returns
Andrei Alexandrescu
andrei at erdani.com
Mon May 3 19:11:38 PDT 2010
Simen Kjaeraas wrote:
> Lars Tandle Kyllingstad <lars-9JrgYCcAG2kcWVvVuXF20w at public.gmane.org>
> wrote:
>> // I personally find the following pretty elegant, but
>> // perhaps a bit verbose? And I don't see Tuple being
>> // used much elsewhere in Phobos. (Why?)
>> Tuple!(Pid, "pid", int, "status") waitAny();
>
> This is my favorite. I always feel that Tuple is a bit verbose, I
> believe it's due to the strings. Still, I wish it were used more,
> as it is an elegant solution and one that shows off D's power
> (some).
That would be my fave as well. Its use is picking up, and I think it
should become the preferred Phobos style. It's self-descriptive and very
convenient to use with auto.
Andrei
More information about the phobos
mailing list