The code invoking the loop:
Foo temp = Foo(token.substr(0,i));
this->leftExpression = temp;
Having Foo
declared as:
class Foo{
private:
std::string expr;
std::vector <Bar*> tokens;
std::vector <std::string> stringtoken;
And the CCTOR invoking the loop:
Foo::Foo(const Foo& a_expr){
this->expr = a_expr.expr;
this->tokens = a_expr.tokens;
this->stringtoken = a_expr.stringtoken;
}
What is invoking this loop?
EDIT:
Assignment operator:
Foo& Foo::operator=(const Foo& a_expr){
Foo temp(a_expr);
std::swap(*this, temp);
return (*this);
}