[Issue 5784] Template instantiation with enum constant as parameter, missing implicit cast
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 19 16:36:19 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=5784
Infiltrator <lt.infiltrator at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |lt.infiltrator at gmail.com
Resolution| |WORKSFORME
--- Comment #1 from Infiltrator <lt.infiltrator at 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: -------
More information about the Digitalmars-d-bugs
mailing list