[Issue 3608] New: Allow isExpression and templates to capture template parameters and FQN of template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 11 07:26:58 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3608

           Summary: Allow isExpression and templates to capture template
                    parameters and FQN of template
           Product: D
           Version: future
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2009-12-11 07:26:57 PST ---
Currently, there is no way to extract FQN of a template from an instantiation,
nor to get its parameters. This is not completely true, as one could parse its
stringof representation, but this is often not enough.

I therefore propose that the following syntax be allowed:

template foo( T : U!( V ), U, V... )

Thus, one could get the base template or parameters of an instantiation using
the following templates:

template BaseTemplate( T : U!( V ), U, V... ) {
  alias U BaseTemplate;
}
template TemplateParameters( T : U!( V ), U, V... ) {
  alias V TemplateParameters;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list