[Issue 2550] implicit conversions don't apply to template value parameter specialization
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 24 07:15:55 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2550
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug at yahoo.com.au
Summary|template specialization not |implicit conversions don't
|working because of "static |apply to template value
|if"? |parameter specialization
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-09-24 07:15:54 PDT ---
Original title: 'template specialization not working because of "static if"?'
It's not because of 'static if'. This shows the same problem:
template pow10(long n){
const long pow10=7;
}
template pow10(long n:0){
const long pow10=1;
}
static assert(pow10!(0) == 1);
It will compile if you put
static assert(pow10!(0L) == 1);
It seems that the compiler requires template value specialisations have to
exactly match both type and value, but I don't see that in the spec anywhere.
Probably a bug. It's certainly pretty annoying.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list