Possible duplicate:
Overloading an overloaded database in C ++
I have a class like this:
class Object {
public:
int alignment() const;
virtual void alignment(int i);
};
that I am trying to subclass as follows:
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 call the function expected 1 have 0." I do not understand why a virtual function that takes an argument gets confused with a non-virtual constant. Can someone explain why?
source
share