Fully transitive const is not necessary

Janice Caron caron800 at googlemail.com
Thu Apr 3 01:00:20 PDT 2008


On 02/04/2008, Sean Kelly <sean at invisibleduck.org> wrote:
> My traditional argument in support of logical const is this:
>
>     class C
>     {
>         mutable mutex monitor;
>         <snip>
>     };

But in D, the class C will already have a mutex, by virtue of the fact
that it derives from Object.

...which raises an interesting point. Can "synchronized" be used on a
const object? What about an invariant object?



More information about the Digitalmars-d mailing list