1 | #include <cstdio> |
---|---|
2 | #include <string> |
3 | #include <unordered_map> |
4 | |
5 | using StringMapT = std::unordered_map<std::string, std::string>; |
6 | |
7 | int main() { |
8 | StringMapT string_map; |
9 | { |
10 | auto empty_iter = string_map.begin(); |
11 | auto const_empty_iter = string_map.cbegin(); |
12 | std::printf(format: "Break here"); |
13 | } |
14 | string_map["Foo"] = "Bar"; |
15 | string_map["Baz"] = "Qux"; |
16 | |
17 | { |
18 | auto foo = string_map.find(x: "Foo"); |
19 | auto invalid = string_map.find(x: "Invalid"); |
20 | |
21 | StringMapT::const_iterator const_baz = string_map.find(x: "Baz"); |
22 | auto bucket_it = string_map.begin(n: string_map.bucket(key: "Baz")); |
23 | auto const_bucket_it = string_map.cbegin(n: string_map.bucket(key: "Baz")); |
24 | std::printf(format: "Break here"); |
25 | } |
26 | |
27 | return 0; |
28 | } |
29 |