www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20010] New: allow cast of type, not only expressions

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

          Issue ID: 20010
           Summary: allow cast of type, not only expressions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

People write stuff like : 

    mixin("alias Func = " ~ typeof(&impl).stringof ~ " pure nothrow;");

to set the attributes of a function. We could have something like

    alias Func = cast(pure nothrow) typeof(&impl);

or even using the TypeCtor style

    alias Func = pure(nothrow(typeof(&impl)));

This probably requires a DIP but I open an issue to keep track of the idea.

--
Jun 29 2019