[Issue 8420] New: isExpression and templates should capture all template parameters when using variadic TemplateParameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 23 07:13:04 PDT 2012


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

           Summary: isExpression and templates should capture all template
                    parameters when using variadic TemplateParameter
           Product: D
           Version: D2
          Platform: All
        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> 2012-07-23 07:12:49 PDT ---
template TemplateInfo( T ) {
    static if ( is( T t == U!V, alias U, V... ) ) {
        alias U Template;
        alias V Arguments;
    }
}

The above template easily matches Tuple!(whatever), since Tuple is a template
with only one parameter, which is variadic. It does not, however, match
Rebindable!MyClass, since that template does not follow the pattern.

The idea behind bug 3608 was to cover exactly this, but it has been
insufficiently communicated in that report, hence this new report.

tl;dr: inside an IsExpression, T... should match a whole TemplateParameterList,
not just a TemplateTupleParameter.

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