Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 126 additions & 125 deletions stl/inc/algorithm

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions stl/inc/execution
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ struct _Static_partitioned_mismatch2 {
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD pair<_FwdIt1, _FwdIt2> mismatch(
_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) noexcept /* terminates */ {
// return [_First1, _Last1)/[_First2, ...) mismatch using _Pred
// return [_First1, _Last1)/[_First2, ...) mismatch
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_Adl_verify_range(_First1, _Last1);
Expand Down Expand Up @@ -1913,7 +1913,7 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch(
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD pair<_FwdIt1, _FwdIt2> mismatch(
_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ {
// return [_First1, _Last1)/[_First2, _Last2) mismatch using _Pred
// return [_First1, _Last1)/[_First2, _Last2) mismatch
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_Adl_verify_range(_First1, _Last1);
Expand Down Expand Up @@ -1991,7 +1991,7 @@ struct _Static_partitioned_equal2 {
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, _Pr _Pred) noexcept
/* terminates */ {
// compare [_First1, _Last1) to [_First2, ...) using _Pred
// compare [_First1, _Last1) to [_First2, ...)
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_Adl_verify_range(_First1, _Last1);
Expand Down Expand Up @@ -2024,7 +2024,7 @@ _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, cons
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2,
_Pr _Pred) noexcept /* terminates */ {
// compare [_First1, _Last1) to [_First2, _Last2) using _Pred
// compare [_First1, _Last1) to [_First2, _Last2)
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_Adl_verify_range(_First1, _Last1);
Expand Down Expand Up @@ -2740,7 +2740,7 @@ struct _Sort_operation { // context for background threads

template <class _ExPo, class _RanIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void sort(_ExPo&&, const _RanIt _First, const _RanIt _Last, _Pr _Pred) noexcept /* terminates */ {
// order [_First, _Last), using _Pred
// order [_First, _Last)
_Adl_verify_range(_First, _Last);
const auto _UFirst = _Get_unwrapped(_First);
const auto _ULast = _Get_unwrapped(_Last);
Expand Down Expand Up @@ -2998,7 +2998,7 @@ struct _Static_partitioned_stable_sort3 {

template <class _ExPo, class _BidIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void stable_sort(_ExPo&&, const _BidIt _First, const _BidIt _Last, _Pr _Pred) noexcept /* terminates */ {
// sort preserving order of equivalents, using _Pred
// sort preserving order of equivalents
_Adl_verify_range(_First, _Last);
const auto _UFirst = _Get_unwrapped(_First);
const auto _ULast = _Get_unwrapped(_Last);
Expand Down Expand Up @@ -3314,7 +3314,7 @@ struct _Static_partitioned_is_heap_until {

template <class _ExPo, class _RanIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD _RanIt is_heap_until(_ExPo&&, _RanIt _First, _RanIt _Last, _Pr _Pred) noexcept /* terminates */ {
// find extent of range that is a heap ordered by _Pred
// find extent of range that is a heap
_REQUIRE_PARALLEL_ITERATOR(_RanIt);
_Adl_verify_range(_First, _Last);
const auto _UFirst = _Get_unwrapped(_First);
Expand Down Expand Up @@ -3910,7 +3910,7 @@ template <class _ExPo, class _FwdIt1, class _FwdIt2, class _FwdIt3, class _Pr,
_Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest,
_Pr _Pred) noexcept /* terminates */ {
// AND sets [_First1, _Last1) and [_First2, _Last2), using _Pred
// AND sets [_First1, _Last1) and [_First2, _Last2)
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt3);
Expand Down Expand Up @@ -4001,7 +4001,7 @@ template <class _ExPo, class _FwdIt1, class _FwdIt2, class _FwdIt3, class _Pr,
_Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest,
_Pr _Pred) noexcept /* terminates */ {
// take set [_First2, _Last2) from [_First1, _Last1), using _Pred
// take set [_First2, _Last2) from [_First1, _Last1)
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt3);
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/forward_list
Original file line number Diff line number Diff line change
Expand Up @@ -1342,12 +1342,12 @@ private:
}

public:
void sort() { // order sequence, using operator<
void sort() { // order sequence
_Scary_val::_Sort(_Mypair._Myval2._Before_head(), less<>{});
}

template <class _Pr2>
void sort(_Pr2 _Pred) { // order sequence, using _Pred
void sort(_Pr2 _Pred) { // order sequence
_Scary_val::_Sort(_Mypair._Myval2._Before_head(), _Pass_fn(_Pred));
}

Expand Down
6 changes: 3 additions & 3 deletions stl/inc/list
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public:

template <class _Pr2>
static _Nodeptr _Sort(_Nodeptr& _First, const size_type _Size, _Pr2 _Pred) {
// order [_First, _Last), using _Pred, return _First + _Size
// order [_First, _Last), return _First + _Size
switch (_Size) {
case 0:
return _First;
Expand Down Expand Up @@ -1706,12 +1706,12 @@ private:
}

public:
void sort() { // order sequence, using operator<
void sort() { // order sequence
sort(less<>());
}

template <class _Pr2>
void sort(_Pr2 _Pred) { // order sequence, using _Pred
void sort(_Pr2 _Pred) { // order sequence
auto& _My_data = _Mypair._Myval2;
_Scary_val::_Sort(_My_data._Myhead->_Next, _My_data._Mysize, _Pass_fn(_Pred));
}
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ _STD_BEGIN
template <class _Ty, class _Pr>
_NODISCARD constexpr const _Ty&(max)(const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept(
noexcept(_Pred(_Left, _Right))) /* strengthened */ {
// return larger of _Left and _Right using _Pred
// return larger of _Left and _Right
return _Pred(_Left, _Right) ? _Right : _Left;
}

Expand All @@ -55,7 +55,7 @@ _NODISCARD constexpr _Ty(max)(initializer_list<_Ty>); // implemented in <algorit
template <class _Ty, class _Pr>
_NODISCARD constexpr const _Ty&(min)(const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept(
noexcept(_Pred(_Right, _Left))) /* strengthened */ {
// return smaller of _Left and _Right using _Pred
// return smaller of _Left and _Right
return _Pred(_Right, _Left) ? _Right : _Left;
}

Expand Down
24 changes: 12 additions & 12 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -4920,7 +4920,7 @@ _INLINE_VAR constexpr bool _Equal_memcmp_is_safe =
#if _HAS_IF_CONSTEXPR
template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD _CONSTEXPR20 bool equal(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, _Pr _Pred) {
// compare [_First1, _Last1) to [_First2, ...) using _Pred
// compare [_First1, _Last1) to [_First2, ...)
_Adl_verify_range(_First1, _Last1);
auto _UFirst1 = _Get_unwrapped(_First1);
const auto _ULast1 = _Get_unwrapped(_Last1);
Expand Down Expand Up @@ -4948,7 +4948,7 @@ _NODISCARD _CONSTEXPR20 bool equal(const _InIt1 _First1, const _InIt1 _Last1, co
#else // ^^^ _HAS_IF_CONSTEXPR / !_HAS_IF_CONSTEXPR vvv
template <class _InIt1, class _InIt2, class _Pr, enable_if_t<!_Equal_memcmp_is_safe<_InIt1, _InIt2, _Pr>, int> = 0>
bool _Equal_unchecked(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, _Pr _Pred) {
// compare [_First1, _Last1) to [_First2, ...) using _Pred, no special optimization
// compare [_First1, _Last1) to [_First2, ...), no special optimization
for (; _First1 != _Last1; ++_First1, (void) ++_First2) {
if (!_Pred(*_First1, *_First2)) {
return false;
Expand All @@ -4969,7 +4969,7 @@ bool _Equal_unchecked(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _F

template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD bool equal(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, _Pr _Pred) {
// compare [_First1, _Last1) to [_First2, ...) using _Pred
// compare [_First1, _Last1) to [_First2, ...)
_Adl_verify_range(_First1, _Last1);
const auto _UFirst1 = _Get_unwrapped(_First1);
const auto _ULast1 = _Get_unwrapped(_Last1);
Expand Down Expand Up @@ -5003,7 +5003,7 @@ _NODISCARD bool equal(_ExPo&& _Exec, const _FwdIt1 _First1, const _FwdIt1 _Last1
template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD _CONSTEXPR20 bool equal(
const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred) {
// compare [_First1, _Last1) to [_First2, _Last2) using _Pred
// compare [_First1, _Last1) to [_First2, _Last2)
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
auto _UFirst1 = _Get_unwrapped(_First1);
Expand Down Expand Up @@ -5039,7 +5039,7 @@ _NODISCARD _CONSTEXPR20 bool equal(
template <class _InIt1, class _InIt2, class _Pr>
bool _Equal_unchecked(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred,
input_iterator_tag, input_iterator_tag) {
// compare [_First1, _Last1) to [_First2, _Last2) using _Pred, arbitrary iterators
// compare [_First1, _Last1) to [_First2, _Last2), arbitrary iterators
for (;;) {
if (_First1 == _Last1) {
return _First2 == _Last2;
Expand All @@ -5061,7 +5061,7 @@ bool _Equal_unchecked(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, const
template <class _InIt1, class _InIt2, class _Pr>
bool _Equal_unchecked(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred,
random_access_iterator_tag, random_access_iterator_tag) {
// compare [_First1, _Last1) to [_First2, _Last2) using _Pred, random-access iterators
// compare [_First1, _Last1) to [_First2, _Last2), random-access iterators
if (_Last1 - _First1 != _Last2 - _First2) {
return false;
}
Expand All @@ -5071,7 +5071,7 @@ bool _Equal_unchecked(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _F

template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD bool equal(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred) {
// compare [_First1, _Last1) to [_First2, _Last2) using _Pred
// compare [_First1, _Last1) to [_First2, _Last2)
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
return _Equal_unchecked(_Get_unwrapped(_First1), _Get_unwrapped(_Last1), _Get_unwrapped(_First2),
Expand Down Expand Up @@ -5159,7 +5159,7 @@ constexpr auto _Lex_compare_memcmp_classify(_Obj1* const&, _Obj2* const&, const
template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD constexpr bool _Lex_compare_unchecked(
_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred, _Lex_compare_optimize<void>) {
// order [_First1, _Last1) vs. [_First2, _Last2) using _Pred, no special optimization
// order [_First1, _Last1) vs. [_First2, _Last2), no special optimization
for (; _First1 != _Last1 && _First2 != _Last2; ++_First1, (void) ++_First2) { // something to compare, do it
if (_DEBUG_LT_PRED(_Pred, *_First1, *_First2)) {
return true;
Expand Down Expand Up @@ -5190,7 +5190,7 @@ _NODISCARD _CONSTEXPR20 bool _Lex_compare_unchecked(
template <class _InIt1, class _InIt2, class _Pr>
_NODISCARD _CONSTEXPR20 bool lexicographical_compare(
_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred) {
// order [_First1, _Last1) vs. [_First2, _Last2) using _Pred
// order [_First1, _Last1) vs. [_First2, _Last2)
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
const auto _UFirst1 = _Get_unwrapped(_First1);
Expand All @@ -5211,7 +5211,7 @@ _NODISCARD _CONSTEXPR20 bool lexicographical_compare(_InIt1 _First1, _InIt1 _Las
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> = 0>
_NODISCARD bool lexicographical_compare(
_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ {
// order [_First1, _Last1) vs. [_First2, _Last2) using _Pred
// order [_First1, _Last1) vs. [_First2, _Last2)
// not parallelized at present, parallelism expected to be feasible in a future release
_REQUIRE_PARALLEL_ITERATOR(_FwdIt1);
_REQUIRE_PARALLEL_ITERATOR(_FwdIt2);
Expand Down Expand Up @@ -5772,7 +5772,7 @@ _NODISCARD _CONSTEXPR20 _InIt find_if(_InIt _First, const _InIt _Last, _Pr _Pred
// FUNCTION TEMPLATE lower_bound
template <class _FwdIt, class _Ty, class _Pr>
_NODISCARD _CONSTEXPR20 _FwdIt lower_bound(_FwdIt _First, const _FwdIt _Last, const _Ty& _Val, _Pr _Pred) {
// find first element not before _Val, using _Pred
// find first element not before _Val
_Adl_verify_range(_First, _Last);
auto _UFirst = _Get_unwrapped(_First);
_Iter_diff_t<_FwdIt> _Count = _STD distance(_UFirst, _Get_unwrapped(_Last));
Expand All @@ -5794,7 +5794,7 @@ _NODISCARD _CONSTEXPR20 _FwdIt lower_bound(_FwdIt _First, const _FwdIt _Last, co

template <class _FwdIt, class _Ty>
_NODISCARD _CONSTEXPR20 _FwdIt lower_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val) {
// find first element not before _Val, using operator<
// find first element not before _Val
return _STD lower_bound(_First, _Last, _Val, less<>());
}

Expand Down