Const question

Simen Kjaeraas simen.kjaras at gmail.com
Mon Mar 24 11:56:22 PDT 2008


On Sun, 23 Mar 2008 23:51:31 +0100, Graham St Jack <grahams at acres.com.au>  
wrote:

> I have finally taken the plunge and moved over to D 2.x.
>
> The experience is good so far except for a few problems with const (I
> want const btw), the biggest of which is the tail-const issue for
> classes, which is still an active area of discussion.
>
> My question is more mundane - are there plans to fix the const-
> correctness of things in the language and phobos, specifically things
> like opCmp, opAdd, etc? I find I am having to cast away const in order to
> use overloaded operators, which is very annoying.


opAdd and friends are easy to fix in most situations:

     const Foo opAdd(const Foo rhs)

Of course, if this pattern is not used in the std lib, that is Walter's  
(and others') job.

-- Simen



More information about the Digitalmars-d mailing list