Why D const is annoying

Mehrdad wfunction at hotmail.com
Sat Dec 10 02:18:31 PST 2011


... and another...

struct S(T, int N)
{ public auto opBinary(string op)(in S!(T, N) other) const { return 
this; } }
void main() { S!(int, 1) m; m = m * m; }

Error: 'm' is not of arithmetic type, it is a Matrix!(int,1)
Error: 'm' is not of arithmetic type, it is a Matrix!(int,1)


More information about the Digitalmars-d mailing list