| 1 | #include <set> |
|---|---|
| 2 | #include <string> |
| 3 | |
| 4 | int g_the_foo = 0; |
| 5 | |
| 6 | int thefoo_rw(int arg = 1) { |
| 7 | if (arg < 0) |
| 8 | arg = 0; |
| 9 | if (!arg) |
| 10 | arg = 1; |
| 11 | g_the_foo += arg; |
| 12 | return g_the_foo; |
| 13 | } |
| 14 | |
| 15 | void by_ref_and_ptr(std::multiset<int> &ref, std::multiset<int> *ptr) { |
| 16 | // Stop here to check by ref and ptr |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | int main() { |
| 21 | std::multiset<int> ii; |
| 22 | thefoo_rw(arg: 1); // Set break point at this line. |
| 23 | |
| 24 | ii.insert(x: 0); |
| 25 | ii.insert(x: 1); |
| 26 | ii.insert(x: 2); |
| 27 | ii.insert(x: 3); |
| 28 | ii.insert(x: 4); |
| 29 | ii.insert(x: 5); |
| 30 | thefoo_rw(arg: 1); // Set break point at this line. |
| 31 | |
| 32 | ii.insert(x: 6); |
| 33 | thefoo_rw(arg: 1); // Set break point at this line. |
| 34 | |
| 35 | by_ref_and_ptr(ref&: ii, ptr: &ii); |
| 36 | |
| 37 | ii.clear(); |
| 38 | thefoo_rw(arg: 1); // Set break point at this line. |
| 39 | |
| 40 | std::multiset<std::string> ss; |
| 41 | thefoo_rw(arg: 1); // Set break point at this line. |
| 42 | |
| 43 | ss.insert(x: "a"); |
| 44 | ss.insert(x: "a very long string is right here"); |
| 45 | thefoo_rw(arg: 1); // Set break point at this line. |
| 46 | |
| 47 | ss.insert(x: "b"); |
| 48 | ss.insert(x: "c"); |
| 49 | thefoo_rw(arg: 1); // Set break point at this line. |
| 50 | |
| 51 | ss.erase(x: "b"); |
| 52 | thefoo_rw(arg: 1); // Set break point at this line. |
| 53 | |
| 54 | return 0; |
| 55 | } |
| 56 |
