March 19, 2014 [Issue 5784] Template instantiation with enum constant as parameter, missing implicit cast | ||||
---|---|---|---|---|
| ||||
https://d.puremagic.com/issues/show_bug.cgi?id=5784 Infiltrator <lt.infiltrator@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |lt.infiltrator@gmail.com Resolution| |WORKSFORME --- Comment #1 from Infiltrator <lt.infiltrator@gmail.com> 2014-03-19 16:36:18 PDT --- This seems to be fixed as of v2.065. The following compiles. ------------------------------------------------------- struct A(int n) { bool[n] nBooleans; } template isA(T) { static if (is(T X == A!N, int N)) enum isA = true; else enum isA = false; } enum int boolCount = 5; alias A!boolCount fromEnum; alias A!5 fromLiteral; static assert(isA!(A!5)); // no longer fails static assert(isA!(A!boolCount)); // no longer fails static assert(is(A!5 == A!boolCount)); // pass ------------------------------------------------------- -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation