any news on const/invariant?
Walter Bright
newshound1 at digitalmars.com
Tue Nov 27 12:59:45 PST 2007
Chris Miller wrote:
> When grouping with : or { } it applies to the actual named declarations
> it encloses; but if const is applied before the return type, precedence
> (the juxtaposition) dictates association with the return type.
>
> This is what I would assume.
Think about const as applying to the item being declared. Here, foo is
being declared, so const applies to the foo. Not its return type.
It would also completely break the consistency of storage classes if:
const:
const { }
const
meant different things.
More information about the Digitalmars-d
mailing list