Trass3r <u...@known.com> wrote:

class F
{
const Foo bar();
}

Isn't this ambiguous? "returns a const Foo object" vs. "is a const
member function that returns a Foo object"?

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

I do agree it is ambiguous though, and should be disallowed, or at
very least, discouraged.

--
Simen

Reply via email to