Jonathan M Davis <jmdavisp...@gmx.com> wrote:

Only to humans. const applies to everything after it, unless there
are parentheses. In this case, 'everything' is Foo bar();

Not quite right. The return value is _not_ const in this case. It's
only the function which is affected. Try it and you'll see. The _only_
time that a return value is const or immutable is if you use parens to
mark it that way.

I could probably have worded that more clearly.

*clears throat*
const applies to one, and exactly one, thing after it, matched greedily.

So yes, Foo bar() is the 'everything'. Foo and Foo bar() would be two
things.

--
Simen

Reply via email to