P
pauldepstein
The following code was written by a colleague -- to preserve
confidentiality, the name of the class is changed:
HisClass operator+ (const HisClass & h1, const HisClass & h2)
{ // some code here}
HisClass HisClass:perator+ (const HisClass& h2)
{// more code here}
To me, this code appears to be in error because it appears to make
expressions such as h1 + h2 ambiguous.
It does compile though.
I'd like to run it by the newsgroup because it's an established part
of our library and I'd be a bit surprised to see a fundamental error
of this nature.
Am I missing something?
After writing this, I can now guess what happens. Is it the case that
only the 2nd version {//more code here} ever gets called because its
scope is narrower?
Thanks,
Paul Epstein
confidentiality, the name of the class is changed:
HisClass operator+ (const HisClass & h1, const HisClass & h2)
{ // some code here}
HisClass HisClass:perator+ (const HisClass& h2)
{// more code here}
To me, this code appears to be in error because it appears to make
expressions such as h1 + h2 ambiguous.
It does compile though.
I'd like to run it by the newsgroup because it's an established part
of our library and I'd be a bit surprised to see a fundamental error
of this nature.
Am I missing something?
After writing this, I can now guess what happens. Is it the case that
only the 2nd version {//more code here} ever gets called because its
scope is narrower?
Thanks,
Paul Epstein