Debian Codegraph @

yo/stl/examples/inilist/main.cc

raw
1 //#define XERR
2 #include "main.ih"
3
4 vector<bool> IniList::s_memory;
5
6 IniList factory(IniList const &src)
7 {
8 cout << "factor(IniList const &)\n";
9 return src;
10 }
11
12 int main(int argc, char **argv)
13 {
14 cout << "\n"
15 "starting main, after constructing 'map'\n"
16 "\n";
17
18 IniList i1;
19
20 {
21 IniList i2(i1);
22 i2.check("copy: ");
23 }
24
25 i1.check("check: ");
26
27 cout << '\n';
28
29 IniList i0(factory(IniList{})); // i0 has lost access to its memory!
30 i0.check("via factory: ");
31
32 cout << "\n"
33 "Now the map:\n"
34 "\n";
35
36 map.find(1)->second.check("element from map: ");
37 }