Maybe somebody could please help me understand why I fail to write stl's map of vectors into a file using CFile::Write()?
typedef std::vector<CLocation> LocationArray;
typedef std::map<int, LocationArray > MapLocationArray;
...
int iSize = sizeof(m_mapLocations);
cf->Write(&iSize, sizeof(iSize));
cf->Write(&m_mapLocations, iSize);
When I am writing, the m_mapLocations contains valid data. But when I read from file, it is empty, though the iSize is correct...
int iSize = 0;
cf->Read(&iSize, sizeof(iSize));
if(iSize > 0)
cf->Read(&m_mapLocations, iSize);