unclear compile error for struct with string template
Oleg B via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Aug 25 04:34:17 PDT 2014
[code]
void doSome(size_t N, T, string AS)( vec!(N,T,AS) v ) { }
struct vec(size_t N, T, string AS) { T[N] data; }
void main() { doSome( vec!(3,float,"xyz")([1,2,3]) ); }
[/code]
compile with new dmd v2.066.0 and get error:
Error: template opbin.doSome(ulong N, T, string AS)(vec!(N, T,
AS) v) specialization not allowed for deduced parameter AS
what does it mean?
on dmd v2.065 it worked well
code without string template parameter work well on dmd v2.066.0
[code]
void doSome(size_t N, T)( vec!(N,T) v ) { }
struct vec(size_t N, T) { T[N] data; }
void main() { doSome( vec!(3,float)([1,2,3]) ); }
[/code]
More information about the Digitalmars-d-learn
mailing list