Feature request: Templates as template parameters

Simen Kjaeraas simen.kjaras at gmail.com
Mon Mar 24 17:42:53 PDT 2008

On Tue, 25 Mar 2008 00:59:16 +0100, Jarrett Billingsley  
<kb3ctd2 at yahoo.com> wrote:

> "Simen Kjaeraas" <simen.kjaras at gmail.com> wrote in message
> news:op.t8jdb1dg1hx7vj at spill04...
> On Mon, 24 Mar 2008 01:07:43 +0100, Jarrett Billingsley
> <kb3ctd2 at yahoo.com> wrote:
> You are right, of course. New question, then: How do I check if a  
> template
> alias parameter is a template?
> T.stringof does give me some information, perhaps it is enough to check
> that it is on the form .*\(.*\).
> -- Simen
> I'm not sure that you can.  It'll just fail if you try to  
> instantiate/mix it
> in if it's not a template, though you'll probably get a less-than-helpful
> error message in that case.

Exactly. Especially when it is hidden behind another template for more  
prettiful syntax. Hence

     template foo(alias T : template)

would be a Good Thing(tm), imho.

-- Simen

More information about the Digitalmars-d-learn mailing list