Open utterances-bot opened 2 years ago
auto n2 = m.extract(2);
m.key() = 5; --> n2.key() = 5;
@GuloWang Thanks for spotting the typo! I fixed it.
in section "Make New Sets/Maps", the template parameter of map is wrong
std::map<int> m1;
std::map<int> m2 {};
erratas in the section Make Keys Hashable
should be
In the Get Size / Query Emptiness section, I believe the code snippets m.insert(3,"x");
and m.insert(1,"y");
should be replaced with m.insert({ 3,"x"});
and m.insert({1,"y"});
respectively.
C++ Standard Library Associative Containers | hacking C++
Learn about C++'s standard (STL) associative containers modeling sets, key-value maps and hash sets/maps.
https://hackingcpp.com/cpp/std/associative_containers.html