Bug 9945 – Add typeFromId __traits

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-16T14:56:55Z
Last change time
2024-12-13T18:06:08Z
Assigned to
No Owner
Creator
timon.gehr
Depends on
9943
Moved to GitHub: dmd#18564 →

Comments

Comment #0 by timon.gehr — 2013-04-16T14:56:55Z
Once typeid can be returned from functions, something like this could become useful: 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.
Comment #1 by robert.schadek — 2024-12-13T18:06:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18564 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB