Hi,
I have a std::map, and I would like to add a valid key to iterate over it later, but without giving any value (it will be given later on in the course of the iterations).
This is how I do it for now :
std::vector<std::string> valid_keys;
//Fill... Then :
std::map<std::string, float> map;
for(size_t i = 0 ; i < valid_keys.size() ; ++i) {
/*I don't want to do that because in fact I don't use a float type*/
map[valid_keys[i]] = 0.f; //<-
}
//Using :
for(std::map<std::string, float>::iterator it = map.begin() ; it != map.end() ; ++it) {
it->second = 0; //Dummy
}
How can I do that, please ?
Thanks aforehand.