Declaring Ref Variables Inside Function Calls

Daniel Keep daniel.keep.lists at gmail.com
Tue Mar 31 17:07:21 PDT 2009



Andrei Alexandrescu wrote:
> Jarrett Billingsley wrote:
>> On Tue, Mar 31, 2009 at 3:18 PM, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>> import std.typecons;
>>>
>>> Tuple!(int, float) foo()
>>> {
>>>    return tuple(2, 4.5);
>>> }
>>>
>>> The addition of the alias this feature and of constructor templates
>>> makes
>>> std.typecons.Tuple even better.
>>>
>>
>> Cool, but..
>>
>> Why not just make tuples first-class types?  <_<
> 
> Why not not?
> 
> Andrei

Because people keep having to invent hacks to work around the fact that
we can't return tuples.  std.typecons.Tuple is a perfect example of this.

  -- Daniel



More information about the Digitalmars-d mailing list