F
Filimon Roukoutakis
Suppose that we have a function
f(Object*& obj)
and have declared a global std::vector<Object*> vec;
Is it valid to do
void g() {
vec.push_back(new Object);
f(vec.back());
}
ie does f() internally actually have read/write access to the Object
allocated in g() on the heap? If not, what would be the trick to achieve
this? Thanks,
filimon
f(Object*& obj)
and have declared a global std::vector<Object*> vec;
Is it valid to do
void g() {
vec.push_back(new Object);
f(vec.back());
}
ie does f() internally actually have read/write access to the Object
allocated in g() on the heap? If not, what would be the trick to achieve
this? Thanks,
filimon