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 //===----------------------------------------------------------------------===//
15 #include "test_macros.h"
20 bool operator<(const A
& rhs
) const { return i
< rhs
.i
; }
21 static bool isEven(const A
& a
) { return a
.i
% 2 == 0; }
24 void *operator new(size_t, A
*) = delete;
30 std::partition(a
, a
+4, A::isEven
);
31 std::stable_sort(a
, a
+4);
32 std::stable_partition(a
, a
+4, A::isEven
);