I add a vector to another vector using a method (C ++):
a.insert(a.end(), b.begin(), b.end());
It works, but if bobtained from a member function, then it will no longer work, say
vector<point> const line::returnAVectorOfPoints() const
{
vector<point> pts;
return pts;
}
Then this time when I tried (something like this)
a.insert(a.end(), returnAVectorOfPoints().begin(), returnAVectorOfPoints().end());
I have segv. Any ideas what is going wrong here?
source
share