title: Copy constructor invokes infinite loop although having call by reference
body: <p>The code invoking the loop:</p>
  
  <pre><code>Foo temp = Foo(token.substr(0,i));
  this-&gt;leftExpression = temp;
  </code></pre>
  
  <p>Having <code>Foo</code> declared as: </p>
  
  <pre><code>class Foo{
      private:
          std::string expr;
          std::vector &lt;Bar*&gt; tokens;
          std::vector &lt;std::string&gt; stringtoken;
  </code></pre>
  
  <p>And the CCTOR invoking the loop:</p>
  
  <pre><code>Foo::Foo(const Foo&amp; a_expr){
      this-&gt;expr = a_expr.expr;
      this-&gt;tokens = a_expr.tokens;
      this-&gt;stringtoken = a_expr.stringtoken;
  }
  </code></pre>
  
  <p>What is invoking this loop? </p>
  
  <p>EDIT:</p>
  
  <p>Assignment operator: </p>
  
  <pre><code>Foo&amp; Foo::operator=(const Foo&amp; a_expr){
      Foo temp(a_expr);
      std::swap(*this, temp);
      return (*this);
  }
  </code></pre>