7 bool sort_less(int a
, int b
) {
8 __builtin_printf("break here");
12 bool ranges_sort_less(int a
, int b
) {
13 __builtin_printf("break here");
17 int view_transform(int a
) {
18 __builtin_printf("break here");
22 void test_algorithms() {
23 std::vector
<int> vec
{8, 1, 3, 2};
25 // The internal frames for `std::sort` should be hidden
26 std::sort(vec
.begin(), vec
.end(), sort_less
);
28 // The internal frames for `ranges::sort` should be hidden
29 std::ranges::sort(vec
.begin(), vec
.end(), ranges_sort_less
);
32 for (auto x
: vec
| std::ranges::views::transform(view_transform
)) {
37 void consume_number(int i
) { __builtin_printf("break here"); }
39 int invoke_add(int i
, int j
) {
40 __builtin_printf("break here");
45 Callable(int num
) : num_(num
) {}
46 void operator()(int i
) const { __builtin_printf("break here"); }
47 void member_function(int i
) const { __builtin_printf("break here"); }
52 // Invoke a void-returning function
53 std::invoke(consume_number
, -9);
55 // Invoke a non-void-returning function
56 std::invoke(invoke_add
, 1, 10);
58 // Invoke a member function
59 const Callable
foo(314159);
60 std::invoke(&Callable::member_function
, foo
, 1);
62 // Invoke a function object
63 std::invoke(Callable(12), 18);
68 bool operator==(const MyKey
&) const = default;
69 bool operator<(const MyKey
&other
) const {
70 __builtin_printf("break here");
75 void test_containers() {
76 std::map
<MyKey
, int> map
;
77 map
.emplace(MyKey
{1}, 2);
78 map
.emplace(MyKey
{2}, 3);