Any chance to call Tango as Extended Standard Library

Daniel Keep daniel.keep.lists at gmail.com
Sun Jan 18 20:34:33 PST 2009



BLS wrote:
> Andrei Alexandrescu schrieb:
>> BLS wrote:
>>> Look like this works... However it would be nice if we could place
>>> the alias Tuple Pair stuff outside of foo()
>>
>> I'm glad I waited a bit on that one :o). Nice work.
>>
>>> module tt;
>>> import std.stdio;
>>> import std.typecons;
>>>
>>> //alias Tuple!(K, "key", V, "value") Pair; This don't work
>>
>> It doesn't work because at that time the symbols K and V are not
>> visible. But this little simplification should work:
>>
>> template Pair(K, V) {
>>     alias Tuple!(K, "key", V, "value") Pair;
>> }
>>
>>
>> Andrei
> Thanks :) Would be nice to have a Tuple return sample in the
> std.typecons docs. IMO this a not very well known cool D2 feature.
> Bjoern

auto cheez()
{
    return tuple(42, "burger");
}

void main()
{
    auto a,b = cheez();
}

http://mine.icanhascheezburger.com/view.aspx?ciid=3163244

  -- Daniel



More information about the Digitalmars-d mailing list