@@ -15,6 +15,7 @@ import containers.array;
15
15
import containers.begin_end;
16
16
import containers.bidirectional_iterator;
17
17
import containers.iterator;
18
+ import containers.iterator_t ;
18
19
import containers.range;
19
20
import containers.range_size_t ;
20
21
import containers.sentinel_for;
@@ -36,7 +37,7 @@ export constexpr auto is_partitioned = [](range auto && input, auto predicate) -
36
37
return containers::find_if (it, last, predicate) == last;
37
38
};
38
39
39
- export constexpr auto partition_point = []<range Input>(Input && input, auto predicate) {
40
+ export constexpr auto partition_point = []<range Input>(Input && input, auto predicate) -> iterator_t <Input> {
40
41
auto count = bounded::integer<0 , bounded::builtin_max_value<range_size_t <Input>>>(containers::size (input));
41
42
auto first = containers::begin (input);
42
43
if constexpr (numeric_traits::max_value<decltype (count)> == 0_bi) {
@@ -62,7 +63,7 @@ concept decrementable = requires(T value) { --value; };
62
63
63
64
struct partition_t {
64
65
template <iterator ForwardIterator>
65
- static constexpr auto operator ()(ForwardIterator first, sentinel_for<ForwardIterator> auto last, auto predicate) {
66
+ static constexpr auto operator ()(ForwardIterator first, sentinel_for<ForwardIterator> auto last, auto predicate) -> ForwardIterator {
66
67
auto advance_first = [&]{
67
68
first = containers::find_if_not (first, last, predicate);
68
69
};
@@ -100,7 +101,8 @@ struct partition_t {
100
101
}
101
102
return first;
102
103
}
103
- static constexpr auto operator ()(range auto && input, auto predicate) {
104
+ template <range Input>
105
+ static constexpr auto operator ()(Input && input, auto predicate) -> iterator_t<Input> {
104
106
return operator ()(containers::begin (input), containers::end (input), predicate);
105
107
}
106
108
};
@@ -111,7 +113,7 @@ export constexpr auto partition = partition_t();
111
113
// returned.
112
114
struct iterator_partition_t {
113
115
template <bidirectional_iterator Iterator>
114
- constexpr auto operator ()(Iterator first, Iterator middle, Iterator last, auto const compare) const {
116
+ constexpr auto operator ()(Iterator first, Iterator middle, Iterator last, auto const compare) const -> Iterator {
115
117
BOUNDED_ASSERT (first == last or middle != last);
116
118
auto predicate = [&](auto const & value) { return compare (value, *middle); };
117
119
while (true ) {
0 commit comments