Thread: operator dynamics

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490

    operator dynamics

    Code:
    Base& Base::operator+=(Base& e) {
    
    }
    Base& Base::operator+=(Derived& e) {
    
    }
    int main() {
      Base *x, z;
      Derived y;
      z += y;
    
    }
    My problem is that the operator+=(Base&) is called instead of the other one. Any suggestions?
    Last edited by ygfperson; 05-03-2003 at 03:56 PM.

Popular pages Recent additions subscribe to a feed