Commit 335930b89478f1d46ef00af7573e18cb585d6531
1 parent
cee544e6
std::move and std::forward tests
Showing
2 changed files
with
31 additions
and
33 deletions
examples11/04-vectortmpl/testvector.cpp
... | ... | @@ -23,45 +23,42 @@ main () |
23 | 23 | a.push_back(9); |
24 | 24 | a.push_back(10); |
25 | 25 | a.push_back(11); |
26 | + int arg = 13; | |
27 | + a.push_back(arg); | |
26 | 28 | b=a; |
27 | 29 | printvector (b); |
28 | 30 | vector<string> c(10); |
29 | 31 | vector<string> d(15); |
30 | 32 | c[0]="ala"; |
31 | 33 | c[9]="ma kota"; |
32 | - c.push_back("ooo"); | |
33 | - c.push_back("ooo"); | |
34 | - c.push_back("ooo"); | |
35 | - c.push_back("ooo"); | |
36 | - c.push_back("ooo"); | |
37 | - c.push_back("ooo"); | |
38 | - c.push_back("ooo"); | |
39 | - c.push_back("ooo"); | |
40 | - c.push_back("ooo"); | |
41 | - c.push_back("ooo"); | |
42 | - c.push_back("ooo"); | |
43 | - c.push_back("ooo"); | |
44 | - c.push_back("ooo"); | |
45 | - c.push_back("ooo"); | |
46 | - c.push_back("ooo"); | |
47 | - c.push_back("ooo"); | |
48 | - c.push_back("ooo"); | |
49 | - c.push_back("ooo"); | |
50 | - c.push_back("ooo"); | |
51 | - c.push_back("ooo"); | |
52 | - c.push_back("ooo"); | |
53 | - c.push_back("ooo"); | |
54 | - c.push_back("ooo"); | |
55 | - c.push_back("ooo"); | |
56 | - c.push_back("ooo"); | |
57 | - c.push_back("ooo"); | |
58 | - c.push_back("ooo"); | |
59 | - c.push_back("ooo"); | |
60 | - c.push_back("ooo"); | |
61 | - c.push_back("ooo"); | |
62 | - c.push_back("ooo"); | |
63 | - c.push_back("ooo"); | |
64 | - | |
34 | + | |
35 | + const char* long_string="long_string_that_will_not_use_SSO"; | |
36 | + | |
37 | + c.push_back(long_string); | |
38 | + c.push_back(long_string); | |
39 | + c.push_back(long_string); | |
40 | + c.push_back(long_string); | |
41 | + c.push_back(long_string); | |
42 | + c.push_back(long_string); | |
43 | + c.push_back(long_string); | |
44 | + c.push_back(long_string); | |
45 | + c.push_back(long_string); | |
46 | + c.push_back(long_string); | |
47 | + c.push_back(long_string); | |
48 | + c.push_back(long_string); | |
49 | + c.push_back(long_string); | |
50 | + c.push_back(long_string); | |
51 | + c.push_back(long_string); | |
52 | + c.push_back(long_string); | |
53 | + c.push_back(long_string); | |
54 | + c.push_back(long_string); | |
55 | + c.push_back(long_string); | |
56 | + c.push_back(long_string); | |
57 | + c.push_back(long_string); | |
58 | + | |
59 | + string l(long_string); | |
60 | + c.push_back(l); | |
61 | + c.emplace_back(long_string); | |
65 | 62 | cout << "About to assign vector" << endl; |
66 | 63 | d=c; |
67 | 64 | cout << "Vector assigned" << endl; | ... | ... |
examples11/04-vectortmpl/vector.h