Const by Default

Henning Hasemann hhasemann at web.de
Mon Jun 25 00:38:04 PDT 2007


"David B. Held" <dheld at codelogicconsulting.com> schrieb (Sun, 24 Jun
2007 18:02:42 -0700):
>      this(ref MyClass a, ref MyClass b)
>      {
>          a_ = a;
>          b_ = b;
>      }

Ack, having to write ref or final in order to remove const is ugly.
What about an anti-const keyword? Is there anything that speaks against
the following?

this(mutable MyClass a, mutable MyClass b) {
  // ...
}

I'm not sure if mutable is already some keyword so there may be better
choices (noconst/nofinal/noinvariant? volatile?)

Henning

-- 
GPG Public Key:
http://keyserver.ganneff.de:11371/pks/lookup?op=get&search=0xDDD6D36D41911851
Fingerprint: 344F 4072 F038 BB9E B35D  E6AB DDD6 D36D 4191 1851



More information about the Digitalmars-d mailing list