Final by default?

Daniel Kozák kozzi11 at gmail.com
Fri Mar 14 00:51:17 PDT 2014


monarch_dodra píše v Pá 14. 03. 2014 v 07:41 +0000:
> On Friday, 14 March 2014 at 07:06:53 UTC, Andrei Alexandrescu 
> wrote:
> > Also we do need a means to negate others, too.
> >
> > Andrei
> 
> I was going to ask "how many others" are there, but I came up 
> with this list myself. Probably incomplete:
> 
> static
> const/immtable (no "mutable") keyword
> pure
> nothrow
> 
> To a certain extent, there's also @safe/@system, in the sense 
> that it might make sense to "negate" them, rather than "override" 
> them with another keyword.
> 
> Still, when writing something like:
> class A
> {
> @system nothrow:
> 
>      !nothrow
>      !@system
>      void foo();
> }
> 
> I really reads awful: "not nothrow"/"not system"?
class A
{
@system nothrow:
 
      disable(nothrow, @system) void foo();
}

or

class A
{
@system nothrow:
 
      disable(all) void foo();
}



More information about the Digitalmars-d mailing list