This commit is contained in:
2026-06-18 18:42:34 +03:00
parent a95a3a5d1b
commit e1b479a7ef
7 changed files with 719 additions and 17 deletions

View File

@@ -104,7 +104,14 @@ int main()
if (ri) { // should not be
std::println("hmap_move['int_key'] = {}", ri.value());
} else {
std::println("cannot get value of hmap_move['int_key']");
std::println("cannot get value of hmap_move['int_key'] as int");
}
auto rd = hmap_move.get<double>("int_key");
if (rd) { // should not be
std::println("hmap_move['int_key'] = {}", rd.value());
} else {
std::println("cannot get value of hmap_move['int_key'] as double");
}
ri = hmap_copy.get<int>("int_key");
@@ -115,5 +122,11 @@ int main()
}
}
std::println("\n{:*^80}", " hmap size ");
std::println("hmap.size() = {}", hmap.size());
std::println("hmap_move.size() = {}", hmap_move.size());
std::println("hmap_copy.size() = {}", hmap_copy.size());
return 0;
}