const/immutable member functions

Simen kjaeraas simen.kjaras at gmail.com
Mon Jan 24 10:53:48 PST 2011


Torarin <torarind at gmail.com> wrote:

> 2011/1/24 bearophile <bearophileHUGS at lycos.com>:
>> 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?
>
> If const is required to go on the right, what do you do if you want to
> mark a bunch of functions const inside {}?

The suggestion is only for const alone on the left-hand side. const: and
const{} would not be affected by such a change.

That said, I consider const Foo bar(); to be a bug, and mercilessly
squish it. I always put const on the right side of functions, and should
I ever write coding guidelines for D, putting it on the left would be a
capital offense.

-- 
Simen


More information about the Digitalmars-d mailing list