Hello,
I want to call a specific operator of specific base class of some class. For simple functions it's easy: I just write SpecificBaseClass::function( args );. How should I implement the same for operators without casting trickery?
Isolated problem:
class A
{
public:
A operator+( const A &other ) const {...}
};
class B : public A
{
public:
B operator+( const B & other ) const {...}
};
...
B a, b;
B c = A::operator+( a, b ); //how this should be implemented? I get an error
...
I get the following error on GCC4.5.1
error: no matching function for call to ‘A::operator+(B&, B&)’
note: candidate is: A A::operator+(const A&) const
Thanks!
EDIT improved the example to better illustrate the problem