Poll: Would you like to try const-by-default or not?
Deewiant
deewiant.doesnotlike.spam at gmail.com
Sun Jun 10 08:23:12 PDT 2007
Jarrett Billingsley wrote:
> 1) C++ style const, where you mark anything that should be const as such.
>
> 2) Parameters are const-by-default, and must be marked mutable otherwise.
> Locals, fields etc. are still mutable by default.
>
Option 2, because it's easier to catch bugs with it.
If you forget to set something const you might accidentally modify it without
meaning to. If you forget to set something mutable, the code doesn't compile.
--
Remove ".doesnotlike.spam" from the mail address.
More information about the Digitalmars-d
mailing list