1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
14 #include "test_macros.h"
18 bool operator<(const A
& rhs
) const { return i
< rhs
.i
; }
19 static bool isEven(const A
& a
) { return a
.i
% 2 == 0; }
22 void *operator new(std::size_t, A
*) = delete;
28 std::sort(a
, a
+4, std::less
<A
>());
29 std::partition(a
, a
+4, A::isEven
);
30 std::stable_sort(a
, a
+4);
31 std::stable_sort(a
, a
+4, std::less
<A
>());
32 std::stable_partition(a
, a
+4, A::isEven
);
33 std::inplace_merge(a
, a
+2, a
+4);
34 std::inplace_merge(a
, a
+2, a
+4, std::less
<A
>());