source: doc/theses/mike_brooks_MMath/programs/lst-issues-wrapped-byref.run.cpp @ 9d6082c

Last change on this file since 9d6082c was 1379c96e, checked in by Peter A. Buhr <pabuhr@…>, 6 months ago

formatting changes to programs

  • Property mode set to 100644
File size: 399 bytes
RevLine 
[5717495]1#include <cstdio>
2
3#if defined INTERPOSED_LIST_NS
4using namespace INTERPOSED_LIST_NS;
5#else
6#include <list>
7using namespace std;
8#endif
9
10int main() {
11
12
13
14
15
16
17
18
19
20// C++
21
22struct req {
[5546f50b]23        int pri, rqr;
[5717495]24
[1379c96e]25};
[5717495]26
27
[1379c96e]28list<req *> reqs;
[5717495]29
30
[1379c96e]31req r1 = {1, 42}, r2 = {2, 42};
[5717495]32
[1379c96e]33reqs.push_front(&r2);
34reqs.push_front(&r1);
[5717495]35
36
37
38
39
40
41
42
43
44
45
46
47
48
49for (auto const& cur : reqs)
[5546f50b]50        printf("{%d %d} ", cur->pri, cur->rqr);
[5717495]51printf("\n");
52
[5546f50b]53}
Note: See TracBrowser for help on using the repository browser.