Original Post
Let's say I have a class called AClass, a STL vector called listOfSomeClass that's a list of variables of type someClass. My question is if I call the function, AClass.someFucntion() and it pushes a SomeClass into the vector list does the object foo get lost after someFunction done executing? In other words if I were to access it using SomeClass.listOfSomeClass[0] would it be a valid object?
class AClass
{
vector <someClass> listOfSomeClass;
void someFunction()
{
SomeClass foo;
listofSomeClass.push_back(foo);
}
};