title: is there a way to copy behavior of a function into another in C++?
body: <pre><code>struct Vec{
      int x;
      int y;
      Vec operator+(const Vec &amp;v){
          x+=v.x;     y+=v.y;
          return *this;
      }
      Vec Vec::operator+=(const Vec &amp;v){
          x+=v.x;     y+=v.y;
          return *this;
      }
  };
  ostream&amp; operator&lt;&lt;(ostream &amp;out, const Vec &amp;v){
      return out &lt;&lt; &quot;x : &quot; &lt;&lt; v.x &lt;&lt; &quot;\ny : &quot; &lt;&lt; v.y &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>
  <p>my + and += operator have same behavior how can I avoid redefinition?</p>