www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9945] New: Add typeFromId __traits


           Summary: Add typeFromId __traits
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch
        Depends on: 9943

--- Comment #0 from timon.gehr gmx.ch 2013-04-16 14:56:55 PDT ---
Once typeid can be returned from functions, something like this could become

auto foo(){ return typeid(int); }
static assert(is(__traits(typeFromId, foo())==int));

i.e., add a way to map a type id to its corresponding type at compile time.

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