0e1dbe4f03e2b501637879814bafb143714c3412
[openbsd] /
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(1));  // break here
17     (numbers.push_back(12));  // break here
18     (numbers.push_back(123));
19     (numbers.push_back(1234));
20     (numbers.push_back(12345)); // break here
21     (numbers.push_back(123456));
22     (numbers.push_back(1234567));
23     by_ref_and_ptr(numbers, &numbers);
24     
25     printf("break here");
26     numbers.clear();
27     
28     (numbers.push_back(7)); // break here
29
30     string_vect strings;
31     (strings.push_back(std::string("goofy")));
32     (strings.push_back(std::string("is")));
33     (strings.push_back(std::string("smart")));
34     printf("break here");
35     (strings.push_back(std::string("!!!")));
36      
37     printf("break here");
38     strings.clear();
39     
40     return 0;  // break here
41 }