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

Last change on this file since 9398177 was 5546f50b, checked in by Peter A. Buhr <pabuhr@…>, 6 months ago

more switch to tabs

  • Property mode set to 100644
File size: 405 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};
25
26
27
28
29list<req*> reqs;
30
31
32req
[5546f50b]33        r1 = {1, 42},
34        r2 = {2, 42};
[5717495]35
36reqs.push_front(
[5546f50b]37        &r2);
[5717495]38reqs.push_front(
[5546f50b]39        &r1);
[5717495]40
41
42
43
44
45
46
47
48
49
50
51
52
53
54for (auto const& cur : reqs)
[5546f50b]55        printf("{%d %d} ", cur->pri, cur->rqr);
[5717495]56printf("\n");
57
[5546f50b]58}
Note: See TracBrowser for help on using the repository browser.