RE: function overloading, parameter list error
From: Michael Böhnisch (MichaelBhnisch_at_discussions.microsoft.com)
Date: 08/25/04
- Next message: Mohit Gupta: "Wake Up thread"
- Previous message: Norman Bullen: "Re: where do the windows class gets registered?"
- In reply to: Chris Hawkins: "RE: function overloading, parameter list error"
- Next in thread: Hendrik Schober: "Re: function overloading, parameter list error"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 17:47:02 -0700
"Chris Hawkins" wrote:
> I thought that functions can also differ by whether or not they are const.
Admitted, this a further cue that is used to distinguish overloads.
However, the const in "Type foo( int x, int y ) const" only indicates that
foo does not change it's object memory. The object that is returned by "foo()
const" still is assignable. I assume foo() is indeed Type::foo() ?
> If I remove the const from the foo(double, double) function everything works
> fine. That is, I can call either foo(int, int) const, foo(int, int), or
> foo(double, double). I thought explicitly casting the operands to double's
> or int's should be enough.
This behaviour startles me. To really get down to the core of your problem
further information is needed. What is the signature of the surrounding
method you are calling the assignment? Is it a const member function of the
same class foo() belongs to?
kind regards,
Michael Böhnisch
- Next message: Mohit Gupta: "Wake Up thread"
- Previous message: Norman Bullen: "Re: where do the windows class gets registered?"
- In reply to: Chris Hawkins: "RE: function overloading, parameter list error"
- Next in thread: Hendrik Schober: "Re: function overloading, parameter list error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|