call superclass operator+

Hi there!

I know this is maybe a very stupid question, but how can I call the superclass operator+ from the subclass operator+?

This is an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
using namespace std;

class Base
{
public:

  Base operator+(const Base& other)
  {
    Base ret;
    return ret;
  }
};

class Derived: public Base
{
public:

  Derived operator+(const Derived& other)
  {
    //how can I call Base operator+
  }
};

int main()
{
  Derived b, b2, b3;
  
  b = b2 + b3;
  
  return 0;
}
how can I call Base operator+
 
Base::operator+( nameOfVariable );
Topic archived. No new replies allowed.