[Issue 15464] New: Template parameter-dependent attributes

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 21 05:56:40 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15464

          Issue ID: 15464
           Summary: Template parameter-dependent attributes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

Related forum discussion:
http://forum.dlang.org/post/n4s66a$i9u$1@digitalmars.com

Attributes should be allowed to depend on template parameters. Without this,
their usefulness is seriously and artificially limited.

Example in the post:

void insertFrontMany(C, R)(C container, R range)
    @BigO(complexity!(C.insertFront) * linearTime)
{
   ...
}

currently does not compile.

Walter and I discussed this language change and we're preapproving it. 
Per Timon Gehr's reply, implementation could achieved the feature by means of a
lowering.

--


More information about the Digitalmars-d-bugs mailing list