title: Overloadig + operator must take either no or single argument linklist
body: <p>Set.h file contains in the public class :</p>
  
  <pre><code> friend const Set operator +(const Set &amp; a, const Set &amp; b);
  </code></pre>
  
  <p>Set.cpp file contains a function called:</p>
  
  <pre><code>const Set Set::operator +(const Set &amp; a, const Set &amp; b)
  </code></pre>
  
  <p>Why is it this error appears: 'const Set Set::operator+(const Set&amp;, const Set&amp;)' must take either zero or one argument' </p>
  
  <p>-edit-</p>
  
  <p>As couple of you guys suggested , removing friend front my .h file lead to two more errors</p>
  
  <p>Set.h:23:53: error: 'const Set Set::operator+(const Set&amp;, const Set&amp;)' must take either zero or one argument
      const Set operator +(const Set &amp; a, const Set &amp; b);</p>
  
  <p>Set.cpp:73:55: error: 'const Set Set::operator+(const Set&amp;, const Set&amp;)' must take either zero or one argument
   const Set Set::operator +(const Set &amp; a, const Set &amp; b){</p>
  
  <p>-edit 2 -</p>
  
  <pre><code>const Set operator +(const Set &amp; a, const Set &amp; b){
  Node * intersection; 
  while(a != nullptr &amp;&amp; b != nullptr){
     if(a-&gt;value &lt; b-&gt;value){
        intersection -&gt; value = a;
        intersecioon = intersection-&gt;next;
        a=a-&gt;next;
     }
     if(a-&gt;value &gt; b-&gt;value){
        intersection -&gt; value = b;
        intersecioon = intersection-&gt;next;
        b=b-&gt;next;
     }
  }
  while(a != nullptr){
        intersection -&gt; value = a;
        intersecioon = intersection-&gt;next;
        a=a-&gt;next;
  }
  while(b != nullptr){
        intersection -&gt; value = b;
        intersecioon = intersection-&gt;next;
        b=b-&gt;next;
  }
  return intersection;
  }
  </code></pre>
  
  <p>This is my operator function.                                                      </p>