any news on const/invariant?
Janice Caron
caron800 at googlemail.com
Tue Nov 27 11:24:07 PST 2007
On 11/27/07, Walter Bright <newshound1 at digitalmars.com> wrote:
> Bill Baxter wrote:
> > I agree. I don't get why we need two ways to express it. What's the
> > benefit of writing const out in front?
>
> 1. It's semantically consistent.
>
> 2. It enables you to 'group' const member functions:
>
> const
> {
> int foo();
> int bar();
> }
Oh, well if you put it like that, I have to agree with you! :-)
The question then becomes, why do we need const at the back?
More information about the Digitalmars-d
mailing list