const/immutable member functions

Steven Schveighoffer schveiguy at yahoo.com
Mon Jan 24 10:46:27 PST 2011


On Mon, 24 Jan 2011 13:36:36 -0500, bearophile <bearophileHUGS at lycos.com>  
wrote:

> 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?

I wouldn't say that I *prefer* the current solution, but the current  
solution is not so bad that I need it changed.

It works fine, despite being confusing.  If it wasn't consistent with the  
rest of the attributes, I'd say it was in need of changes, but it fits  
within the scheme already outlined.

I think we have more important problems to worry about than this.

-Steve


More information about the Digitalmars-d mailing list