File: s-dwarf2.cpp

package info (click to toggle)
uftrace 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,356 kB
  • sloc: ansic: 49,770; python: 11,181; asm: 837; makefile: 769; sh: 637; cpp: 627; javascript: 191
file content (47 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <algorithm>
#include <iostream>

enum xxx {
	FOO = 3,
	BAR,
};
struct empty {};

class A {
    public:
	A(empty e, enum xxx x, long i, const char *s)
		: E(e)
		, X(x)
		, I(i)
		, S(s)
	{
		volatile int dummy; // just not to be optimized

		dummy++;
	}

    private:
	empty E;
	enum xxx X;
	long I;
	const char *S;
};

bool myless(int a, int b)
{
	return a < b;
}

int main()
{
	int x[5] = { 5, 3, 9, 2, 7 };
	empty E;

	A(E, FOO, BAR, "debug info test");

	std::sort(x, x + 5, myless);
	std::sort(x, x + 5, std::less<int>());
	std::sort(x, x + 5, [](int a, int b) { return a < b; });

	return 0;
}