December 27, 2004 template specialization bug | ||||
---|---|---|---|---|
| ||||
Attachments: | Specialization gets broken sometimes. It's possibly related to module facility in D. this works ok(outputs "1 0"): template IsArray(T) { static const bool IsArray = false; } template IsArray(T : T[]) { static const bool IsArray = true; } void main() { printf("%d %d\n",IsArray!(int[]),IsArray!(int)); } 1. When some module, containing a bunch templates is imported,output is "0 0". 2. When template IsArray is moved into another module, containing other templates as well, output is "0 0". However when I tried to isolate the bug by removing uninvolved templates, it disappeared. So I am including the complete code which causes the described behaviour. |
January 01, 2005 Re: template specialization bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Aleksey Bobnev Attachments: | Added to DStress as http://dstress.kuehne.cn/run/template_10.d http://dstress.kuehne.cn/run/template_11.d http://dstress.kuehne.cn/run/template_12.d Thomas |
Copyright © 1999-2021 by the D Language Foundation