I want to specifically invoke the base class method; what’s the most concise way to do this? For example:
class Base
{
public:
bool operator != (Base&);
};
class Child : public Base
{
public:
bool operator != (Child& child_)
{
if(Base::operator!=(child_)) // Is there a more concise syntax than this?
return true;
// ... Some other comparisons that Base does not know about ...
return false;
}
};
No, that is as concise as it gets.
Base::operator!=is the name of the method.And yes, what you are doing is standard.
However, in your example (unless you have removed some code), you do not need
Child::operator!=at all. It does the same thing asBase::operator!=will.