1 | #include <stdio.h> |
---|---|
2 | #include <string> |
3 | #include <vector> |
4 | typedef std::vector<int> int_vect; |
5 | typedef std::vector<std::string> string_vect; |
6 | |
7 | template <class T> |
8 | void by_ref_and_ptr(std::vector<T> &ref, std::vector<T> *ptr) { |
9 | // Stop here to check by ref |
10 | return; |
11 | } |
12 | |
13 | int main() |
14 | { |
15 | int_vect numbers; |
16 | (numbers.push_back(x: 1)); // break here |
17 | (numbers.push_back(x: 12)); // break here |
18 | (numbers.push_back(x: 123)); |
19 | (numbers.push_back(x: 1234)); |
20 | (numbers.push_back(x: 12345)); // break here |
21 | (numbers.push_back(x: 123456)); |
22 | (numbers.push_back(x: 1234567)); |
23 | by_ref_and_ptr(ref&: numbers, ptr: &numbers); |
24 | |
25 | printf(format: "break here"); |
26 | numbers.clear(); |
27 | |
28 | (numbers.push_back(x: 7)); // break here |
29 | |
30 | string_vect strings; |
31 | (strings.push_back(x: std::string("goofy"))); |
32 | (strings.push_back(x: std::string("is"))); |
33 | (strings.push_back(x: std::string("smart"))); |
34 | printf(format: "break here"); |
35 | (strings.push_back(x: std::string("!!!"))); |
36 | |
37 | printf(format: "break here"); |
38 | strings.clear(); |
39 | |
40 | return 0; // break here |
41 | } |
42 |