Possible Duplicate:
Overriding a Base's Overloaded Function in C++
I have a class like this one:
class Object {
public:
int alignment() const;
virtual void alignment(int i);
};
that I try to subclass like this:
class Sub : public Object {
public:
virtual void alignment(int i);
};
then:
Sub *sub = new Sub();
sub->alignment(10);
int a = sub->alignment();
The compiler (clang 1.0) generates an error: "Too few arguments to function call, expected 1, have 0." I don't understand why the virtual function that takes an argument is getting confused with the non-virtual const one. Can someone please explain why?