81a5763559d31365a6b743e1fa139beed441e496
[openbsd] /
1 #include <string>
2 #include <unordered_map>
3 #include <unordered_set>
4
5 using std::string;
6
7 #define intstr_map std::unordered_map<int, string> 
8 #define intstr_mmap std::unordered_multimap<int, string> 
9
10 #define int_set std::unordered_set<int> 
11 #define str_set std::unordered_set<string> 
12 #define int_mset std::unordered_multiset<int> 
13 #define str_mset std::unordered_multiset<string> 
14
15 int g_the_foo = 0;
16
17 int thefoo_rw(int arg = 1)
18 {
19         if (arg < 0)
20                 arg = 0;
21         if (!arg)
22                 arg = 1;
23         g_the_foo += arg;
24         return g_the_foo;
25 }
26
27 int main()
28 {
29         intstr_map map;
30         map.emplace(1,"hello");
31         map.emplace(2,"world");
32         map.emplace(3,"this");
33         map.emplace(4,"is");
34         map.emplace(5,"me");
35         thefoo_rw();  // Set break point at this line.
36         
37         intstr_mmap mmap;
38         mmap.emplace(1,"hello");
39         mmap.emplace(2,"hello");
40         mmap.emplace(2,"world");
41         mmap.emplace(3,"this");
42         mmap.emplace(3,"this");
43         mmap.emplace(3,"this");
44         thefoo_rw();  // Set break point at this line.
45         
46         int_set iset;
47         iset.emplace(1);
48         iset.emplace(2);
49         iset.emplace(3);
50         iset.emplace(4);
51         iset.emplace(5);
52         thefoo_rw();  // Set break point at this line.
53         
54         str_set sset;
55         sset.emplace("hello");
56         sset.emplace("world");
57         sset.emplace("this");
58         sset.emplace("is");
59         sset.emplace("me");
60         thefoo_rw();  // Set break point at this line.
61         
62         int_mset imset;
63         imset.emplace(1);
64         imset.emplace(2);
65         imset.emplace(2);
66         imset.emplace(3);
67         imset.emplace(3);
68         imset.emplace(3);
69         thefoo_rw();  // Set break point at this line.
70         
71         str_mset smset;
72         smset.emplace("hello");
73         smset.emplace("world");
74         smset.emplace("world");
75         smset.emplace("is");
76         smset.emplace("is");
77         thefoo_rw();  // Set break point at this line.
78         
79     return 0;
80 }