virtual-by-default rant

deadalnix deadalnix at gmail.com
Sun Mar 18 08:43:38 PDT 2012


Le 18/03/2012 16:26, Andrei Alexandrescu a écrit :
> On 3/18/12 8:39 AM, deadalnix wrote:
>> It just show the need of keyword to express the opposite of final,
>> virtual. The same problem occur with const immutable, you cannot go back
>> to the mutable world when you use « const: » for example.
>
> Yah, ~const etc. have been suggested a couple of times. Helps casts too.
>
> Andrei

This seems definitively an issue to me. ~const/~final, or 
mutable/virtual would be a huge benefice to the « : » syntax. And youa 
re right, it is also a big plus for casting. I would argue for teh last 
one, especially for the const case, because mutable oppose to both const 
and immutable, so it isn't the opposite of const.

The case is very similar to public/private/protected, and each have it's 
own keyword, and it doesn't seems armful.

Note that the same issue exist for shared (but that one doesn't work 
anyway).


More information about the Digitalmars-d mailing list