Parameterized aliases

Meta jared771 at gmail.com
Mon Aug 12 13:44:10 PDT 2013


On Monday, 12 August 2013 at 20:06:16 UTC, Piotr Szturmaj wrote:
> Hi D community!
>
> What do you think of such templated aliases:
>
> template SomeTemplate(T1, T2) { }
>
> alias Partial(T) = SomeTemplate!(int, T);
>
> alias Specialized = Partial!float; // equivalent to 
> SomeTemplate!(int, float)
>
> I think they could be pretty helpful and they should be 
> relatively easy to implement.

That's a neat idea. I don't know much about the compiler, so I'm 
not sure how easy to implement it would be, but something tells 
me that it wouldn't be trivial.


More information about the Digitalmars-d mailing list