S
shaun
This is going to seem very naïve, I'm afraid:
I have the following:
vector<string> DBXMLStructure::getFolderNames(){
const vector<string> & folderList(m_pdb->listFolders());
return folderList;
}
My question:
when I return folderList, am I returning a reference to something
temporary which may cease to exist? Assuming that m_pdb->listFolders()
returns a vector by value (what if it doesnt?)
sheepish
shaun
I have the following:
vector<string> DBXMLStructure::getFolderNames(){
const vector<string> & folderList(m_pdb->listFolders());
return folderList;
}
My question:
when I return folderList, am I returning a reference to something
temporary which may cease to exist? Assuming that m_pdb->listFolders()
returns a vector by value (what if it doesnt?)
sheepish
shaun