On alias a = b

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


"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.

Or maybe that would be solved (at least for templates) under the proposed 
evil plan with something like this?:

    alias a(T...) = b!(T);





More information about the Digitalmars-d mailing list