On alias a = b

Nick Sabalausky a at a.a
Sat Mar 19 14:39:33 PDT 2011


"KennyTM~" <kennytm at gmail.com> wrote in message 
news:im37b7$i45$1 at digitalmars.com...
> On Mar 20, 11 05:14, Nick Sabalausky wrote:
>> "Andrei Alexandrescu"<SeeWebsiteForEmail at erdani.org>  wrote in message
>> news:im0g0n$1mal$1 at digitalmars.com...
>>> On 3/18/11 3:28 PM, so wrote:
>>>> alias a(T) = b(T, known_type);
>>>>
>>>> Would it be an overkill?
>>>
>>> It's part of the evil plan.
>>>
>>
>> What about stuff like this?:
>>
>>      template foo() {}
>>      template foo(string str) {}
>>      template foo(int i) {}
>>
>>      alias foo bar;
>>
>>      // use bar!(), bar!("str") and bar!(7)
>>
>> Currently that doesn't work (though I forget exactly how it fails). I've
>> been starting to find that to be more and more of a problem. I don't
>> rememebr if it works or not when foo is series of non-templated function
>> overloads. If not, it should, IMO.
>>
>
> Huh? It *does* work. See http://ideone.com/moPhm.
>

Hmm, weird. That works for me on 2.052, too, and also works with function 
overloads instead of templates. I could have sworn there was something like 
that that didn't work. Maybe it was just some corner-case bug. Or maybe I'm 
just nuts and never did come across such a problem...




More information about the Digitalmars-d mailing list