Consider the following code:
static std::unordered_map<std::string, Info> stringCollection;
auto& [it, inserted] = stringCollection.try_emplace(pString);
if (inserted) {
it->second.str = &it->first;
}
return it->second;
This line it->second.str = &it->first is supposed to copy the address of the key (pointer) - but I cannot seem to verify if this will be the case (cannot find reference). Basicly does it->first give me a copy or reference ?