Phlip wrote:[color=blue]
> Pete Becker wrote:
>
>[color=green]
>>Phlip wrote:[/color]
>
>[color=green][color=darkred]
>>>>>I just wonder if it's possible to overload a method only by having a
>>>>>different return type.[/color][/color]
>
>[color=green][color=darkred]
>>>>No[/color][/color]
>
>[color=green][color=darkred]
>>>Google "covariant return types".[/color][/color]
>
>[color=green]
>>No need. His answer is right. Read the question again. <g>[/color]
>
>
> "Overload" would mean "within the same scope", but only if C++ directly
> supported the "method" concept. It doesn't, we are fuzzy, and so "No" is too
> short an answer.
>[/color]
Huh? "Overload," as it's defined in C++, only applies to names declared
"within the same scope." Doesn't matter whether C++ directly supports
the "method" concept, whatever that is.
But if you're right, then please point out at least one context in C++
in which overloading can be based solely on the return type.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)