This commit is contained in:
Timur A. Fatkhullin
2026-06-18 00:31:08 +03:00
parent 10703e22d6
commit a95a3a5d1b
4 changed files with 122 additions and 3 deletions

View File

@@ -96,5 +96,24 @@ int main()
}
}
std::println("\n{:*^80}", " delete key ");
std::println("erase node with key 'int_key'");
if (hmap_move.erase("int_key")) {
auto ri = hmap_move.get<int>("int_key");
if (ri) { // should not be
std::println("hmap_move['int_key'] = {}", ri.value());
} else {
std::println("cannot get value of hmap_move['int_key']");
}
ri = hmap_copy.get<int>("int_key");
if (ri) {
std::println("hmap_copy['int_key'] = {}", ri.value());
} else {
std::println("cannot get value of hmap_copy['int_key']");
}
}
return 0;
}