Why D const is annoying

Mehrdad wfunction at hotmail.com
Sat Dec 10 02:33:49 PST 2011


On 12/10/2011 2:28 AM, so wrote:
> On Sat, 10 Dec 2011 12:18:31 +0200, Mehrdad <wfunction at hotmail.com> 
> wrote:
>
>> ... 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)
>
> Oh fantastic, so you are writing the first bug-free software of our time?

Nope, sorry. :(
I'm listing a bunch of bugs I've found. And yes, I'm [semi-]complaining 
about them in the process.


More information about the Digitalmars-d mailing list