std::unordered_map initialization
问题 When I access an element in std::unordered_map using operator [] for the first time, it is automatically created. What (if any) are guarantees about its initialization? (It is guaranteed to be value initialized, or only to be constructed)? Example: std::unordered_map<void *, size_t> size; char *test = new char[10]; size[test] += 10; Is size[test] guaranteed to be 10 at the end of this sequence? 回答1: Is size[test] guaranteed to be 10 at the end of this sequence? Yes. In the last line of your