1 //===----------------------------------------------------------------------===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 // UNSUPPORTED: c++03, c++11, c++14, c++17 10 // UNSUPPORTED: libcpp-has-no-incomplete-ranges 11 12 // <algorithm> 13 14 // template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity, 15 // indirect_unary_predicate<projected<I, Proj>> Pred> 16 // requires permutable<I> 17 // subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); // Since C++20 18 // 19 // template<bidirectional_range R, class Proj = identity, 20 // indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> 21 // requires permutable<iterator_t<R>> 22 // borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {}); // Since C++20 23 24 #include <algorithm> 25 #include <array> 26 #include <concepts> 27 #include <functional> 28 #include <ranges> 29 30 #include "almost_satisfies_types.h" 31 #include "test_iterators.h" 32 33 // TODO: SFINAE tests. 34 35 constexpr bool test() { 36 // TODO: main tests. 37 // TODO: A custom comparator works. 38 // TODO: A custom projection works. 39 40 return true; 41 } 42 43 int main(int, char**) { 44 test(); 45 static_assert(test()); 46 47 return 0; 48 } 49