I've got a brief grip on this one and I've solved it half-way.
I want to pass a vector to a function by reference so that i don't need to update the vector the function has stored to know all the latest changes in the vector.
This function should do just fine:
void setVector(vector<Classname*> &vectorTemp);
the function from the class where i get the vector looks like this:
vector<Classname>* getVector()
{
return vector;
}
however i am not able to send that vector directly to the function for some reason, this code is invalid:
pointerToClass->setVector(pointerToAnotherClass->getVector());
Al-thought if i do this before i send it, everything works:
vector<Classname*> vectorToSend = pointerToClass->getVector();
pointerToClass->setVector(vectorToSend);
but that results in that i have to constantly update the "vectorToSend" with any new information from the "main" vector and then resend it to the class. How do it work around this? Can't i just send it directly without that middle-step?
How this made any sense, i'm super tired!