|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2018] New: Template with a mixin doesn't work as expected
http://d.puremagic.com/issues/show_bug.cgi?id=2018 Summary: Template with a mixin doesn't work as expected Product: D Version: 2.012 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: bartosz relisoft.com The following template doesn't work: template ToType (string s) { mixin ("alias " ~ s ~ " ToType ;"); } ToType!("int") x; I had to use the following workaround: template ToTypeHelper (string s) { mixin ("alias " ~ s ~ " type;"); } template ToType (string s) { alias ToTypeHelper!(s).type ToType; } -- Apr 20 2008
|