Final by default?

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 14 08:27:27 PDT 2014


On Fri, 14 Mar 2014 11:17:08 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 3/14/14, 4:37 AM, Daniel Murphy wrote:
>> "Walter Bright"  wrote in message news:lfu74a$8cr$1 at digitalmars.com...
>>
>>> > No, it doesn't, because it is not usable if C introduces any virtual
>>> > methods.
>>>
>>> That's what the !final storage class is for.
>>
>> My mistake, I forgot you'd said you were in favor of this.  Being able
>> to 'escape' final certainly gets us most of the way there.
>>
>> !final is really rather hideous though.
>
> A few possibilities discussed around here:
>
> !final
> ~final
> final(false)
> @disable final
>
> I've had an epiphany literally a few seconds ago that "final(false)" has  
> the advantage of being generalizable to "final(bool)" taking any  
> CTFE-able Boolean.

Yes yes yes!

Consider also final!false (i.e. parameterize final)

-Steve


More information about the Digitalmars-d mailing list