const/immutable member functions

bearophile bearophileHUGS at lycos.com
Mon Jan 24 10:36:36 PST 2011


There are six, seven or more people that wish to do something about this situation. TDPL is the D2 reference, but few little changes over its first edition are acceptable if they improve the D language a little.

- Trass3r: asks if the code is ambiguous
- Jonathan M Davis: does't like it and puts const/etc on the right
- Simen kjaeraas thinks it's ambiguous though, and should be disallowed, or at very least, discouraged.
- Jens Mueller: Preferred style is to write const on the right
- Andrej Mitrovic suggests to use @ but says it clutters up source code.
- I agree with Jonathan M Davis.

What other people think about this situation? Do you want const/immutable to be required on the right, or do you prefer the current situation, or do you prefer some other solution?

This is the bug report, that Walter has closed, but if necessary it may be opened up again if enough people are interested in the topic:
http://d.puremagic.com/issues/show_bug.cgi?id=4070

See also:
http://d.puremagic.com/issues/show_bug.cgi?id=4040

Bye,
bearophile


More information about the Digitalmars-d mailing list