Re: Hidden Overloaded C++ Virtual Function
Re: Hidden Overloaded C++ Virtual Function
- Subject: Re: Hidden Overloaded C++ Virtual Function
- From: Philippe Casgrain <email@hidden>
- Date: Wed, 4 Jan 2006 13:12:15 -0500
Le 06-01-04 à 12:23, Scott Ribe a écrit :
Plus, I may want the compiler to stop me from using B::foo(int),
which it will do if I don't declare foo(int) in B.
I'm too new to XCode to promise that this won't give you some other
warning,
but the "standard" (iow perfectly legal C++) way of preventing
B::foo(int)
from being called is to redeclare it as private:
class B : public A {
public:
void foo(float);
private:
void foo(int);
};
And provide no implementation.
Right. But if I have code that calls B::foo() with an int,
compilation will fail instead of casting the int to a float and
calling B::foo(float).
My problem is that I have two conflicting requirements:
* I want to keep the current behavior: casting when appropriate,
failing compilation when no casting can be done.
* I don't want the warning about the hidden overloaded virtual function.
Is there any way to disable the warning for this one class only? If
it's not possible, fine, I would genuinely like to know :-)
Philippe _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden