www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15464] New: Template parameter-dependent attributes

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 puremagic.com
          Reporter: andrei 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.

--
Dec 21 2015