Skip to content

Commit e3f4663

Browse files
authored
Merge pull request MicrosoftDocs#3973 from MicrosoftDocs/main637903934524751285
Repo sync for protected CLA branch
2 parents 166e107 + cea8355 commit e3f4663

14 files changed

+126
-116
lines changed

docs/standard-library/algorithm-functions.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
description: "Learn more about: <algorithm> functions"
33
title: "<algorithm> functions"
4-
ms.date: 06/01/2022
4+
ms.date: 06/07/2022
55
f1_keywords: ["algorithm/std::adjacent_find", "algorithm/std::all_of", "algorithm/std::any_of", "algorithm/std::binary_search", "algorithm/std::copy", "algorithm/std::copy_backward", "algorithm/std::copy_if", "algorithm/std::copy_n", "algorithm/std::equal", "algorithm/std::equal_range", "algorithm/std::fill", "algorithm/std::fill_n", "algorithm/std::find", "algorithm/std::find_end", "algorithm/std::find_first_of", "algorithm/std::find_if", "algorithm/std::find_if_not", "algorithm/std::for_each", "algorithm/std::generate", "algorithm/std::generate_n", "algorithm/std::includes", "algorithm/std::inplace_merge", "algorithm/std::is_heap", "algorithm/std::is_heap_until", "algorithm/std::is_partitioned", "algorithm/std::is_permutation", "algorithm/std::is_sorted", "algorithm/std::is_sorted_until", "algorithm/std::iter_swap", "algorithm/std::lexicographical_compare", "algorithm/std::lower_bound", "algorithm/std::make_heap", "algorithm/std::max", "algorithm/std::max_element", "algorithm/std::merge", "algorithm/std::min", "algorithm/std::minmax", "algorithm/std::minmax_element", "algorithm/std::min_element", "algorithm/std::mismatch", "algorithm/std::move", "algorithm/std::move_backward", "algorithm/std::next_permutation", "algorithm/std::none_of", "algorithm/std::nth_element", "algorithm/std::partial_sort", "algorithm/std::partial_sort_copy", "algorithm/std::partition", "algorithm/std::partition_point", "algorithm/std::pop_heap", "algorithm/std::prev_permutation", "algorithm/std::push_heap", "algorithm/std::random_shuffle", "algorithm/std::remove", "algorithm/std::remove_copy", "algorithm/std::remove_copy_if", "algorithm/std::remove_if", "algorithm/std::replace", "algorithm/std::replace_copy", "algorithm/std::replace_copy_if", "algorithm/std::replace_if", "algorithm/std::reverse", "algorithm/std::reverse_copy", "algorithm/std::rotate", "algorithm/std::rotate_copy", "algorithm/std::search", "algorithm/std::search_n", "algorithm/std::set_difference", "algorithm/std::set_intersection", "algorithm/std::set_symmetric_difference", "algorithm/std::set_union", "algorithm/std::shuffle", "algorithm/std::sort", "algorithm/std::sort_heap", "algorithm/std::stable_partition", "algorithm/std::stable_sort", "algorithm/std::swap_ranges", "algorithm/std::transform", "algorithm/std::unique", "algorithm/std::unique_copy", "algorithm/std::upper_bound", "xutility/std::copy", "xutility/std::copy_backward", "xutility/std::copy_n", "xutility/std::count", "xutility/std::equal", "xutility/std::fill", "xutility/std::fill_n", "xutility/std::find", "xutility/std::is_permutation", "xutility/std::lexicographical_compare", "xutility/std::move", "xutility/std::move_backward", "xutility/std::reverse", "xutility/std::rotate", "algorithm/std::count_if", "algorithm/std::partition_copy", "algorithm/std::swap"]
66
helpviewer_keywords: ["std::adjacent_find [C++]", "std::all_of [C++]", "std::any_of [C++]", "std::binary_search [C++]", "std::copy [C++]", "std::copy_backward [C++]", "std::copy_if [C++]", "std::copy_n [C++]", "std::equal [C++]", "std::equal_range [C++]", "std::fill [C++]", "std::fill_n [C++]", "std::find [C++]", "std::find_end [C++]", "std::find_first_of [C++]", "std::find_if [C++]", "std::find_if_not [C++]", "std::for_each [C++]", "std::generate [C++]", "std::generate_n [C++]", "std::includes [C++]", "std::inplace_merge [C++]", "std::is_heap [C++]", "std::is_heap_until [C++]", "std::is_partitioned [C++]", "std::is_permutation [C++]", "std::is_sorted [C++]", "std::is_sorted_until [C++]", "std::iter_swap [C++]", "std::lexicographical_compare [C++]", "std::lower_bound [C++]", "std::make_heap [C++]", "std::max [C++]", "std::max_element [C++]", "std::merge [C++]", "std::min [C++]", "std::minmax [C++]", "std::minmax_element [C++]", "std::min_element [C++]", "std::mismatch [C++]", "std::move [C++]", "std::move_backward [C++]", "std::next_permutation [C++]", "std::none_of [C++]", "std::nth_element [C++]", "std::partial_sort [C++]", "std::partial_sort_copy [C++]", "std::partition [C++]", "std::partition_point [C++]", "std::pop_heap [C++]", "std::prev_permutation [C++]", "std::push_heap [C++]", "std::random_shuffle [C++]", "std::remove [C++]", "std::remove_copy [C++]", "std::remove_copy_if [C++]", "std::remove_if [C++]", "std::replace [C++]", "std::replace_copy [C++]", "std::replace_copy_if [C++]", "std::replace_if [C++]", "std::reverse [C++]", "std::reverse_copy [C++]", "std::rotate [C++]", "std::rotate_copy [C++]", "std::search [C++]", "std::search_n [C++]", "std::set_difference [C++]", "std::set_intersection [C++]", "std::set_symmetric_difference [C++]", "std::set_union [C++]", "std::shuffle [C++]", "std::sort [C++]", "std::sort_heap [C++]", "std::stable_partition [C++]", "std::stable_sort [C++]", "std::swap_ranges [C++]", "std::transform [C++]", "std::unique [C++]", "std::unique_copy [C++]", "std::upper_bound [C++]", "std::copy [C++]", "std::copy_backward [C++]", "std::copy_n [C++]", "std::count [C++]", "std::equal [C++]", "std::fill [C++]", "std::fill_n [C++]", "std::find [C++]", "std::is_permutation [C++]", "std::lexicographical_compare [C++]", "std::move [C++]", "std::move_backward [C++]", "std::reverse [C++]", "std::rotate [C++]", "std::count_if [C++]", "std::partition_copy [C++]", "std::swap [C++]"]
7+
ms.custom: devdivchpfy22
78
---
89
# `<algorithm>` functions
910

@@ -1308,34 +1309,34 @@ int main()
13081309

13091310
```Output
13101311
Vector sorted by the default binary predicate <:
1311-
-3 -2 -1 -1 0 0 1 2 3 4
1312+
-3 -2 -1 -1 0 0 1 2 3 4
13121313

13131314
Result of equal_range with value = 3:
1314-
-3 -2 -1 -1 0 0 1 2 [ 3 ] 4
1315+
-3 -2 -1 -1 0 0 1 2 [ 3 ] 4
13151316

13161317
Vector sorted by the binary predicate greater:
1317-
4 3 2 1 0 0 -1 -1 -2 -3
1318+
4 3 2 1 0 0 -1 -1 -2 -3
13181319

13191320
Result of equal_range with value = 3:
1320-
4 [ 3 ] 2 1 0 0 -1 -1 -2 -3
1321+
4 [ 3 ] 2 1 0 0 -1 -1 -2 -3
13211322

13221323
Vector sorted by the binary predicate abs_lesser:
1323-
0 0 -1 1 -1 2 -2 3 -3 4
1324+
0 0 -1 1 -1 2 -2 3 -3 4
13241325

13251326
Result of equal_range with value = 3:
1326-
0 0 -1 1 -1 2 -2 [ 3 -3 ] 4
1327+
0 0 -1 1 -1 2 -2 [ 3 -3 ] 4
13271328

13281329
Vector sorted by the default binary predicate <:
1329-
blah cute fluffy fun kittens meowmeowmeow
1330+
blah cute fluffy fun kittens meowmeowmeow
13301331

13311332
Result of equal_range with value = fred:
1332-
blah cute fluffy [ ] fun kittens meowmeowmeow
1333+
blah cute fluffy [ ] fun kittens meowmeowmeow
13331334

13341335
Vector sorted by the binary predicate shorter_than:
1335-
fun cute blah fluffy kittens meowmeowmeow
1336+
fun cute blah fluffy kittens meowmeowmeow
13361337

13371338
Result of equal_range with value = fred:
1338-
fun [ cute blah ] fluffy kittens meowmeowmeow
1339+
fun [ cute blah ] fluffy kittens meowmeowmeow
13391340

13401341
```
13411342

@@ -2102,7 +2103,7 @@ A copy of the function object after it has been applied to all of the elements i
21022103

21032104
### Remarks
21042105

2105-
The algorithm `for_each` is very flexible, allowing the modification of each element within a range in different, user-specified ways. Templatized functions may be reused in a modified form by passing different parameters. User-defined functions may accumulate information within an internal state that the algorithm may return after processing all of the elements in the range.
2106+
The algorithm `for_each` is flexible, allowing the modification of each element within a range in different, user-specified ways. Templatized functions may be reused in a modified form by passing different parameters. User-defined functions may accumulate information within an internal state that the algorithm may return after processing all of the elements in the range.
21062107

21072108
The range referenced must be valid; all pointers must be dereferenceable and, within the sequence, the last position must be reachable from the first by incrementation.
21082109

@@ -6495,7 +6496,7 @@ The order of the elements not removed remains stable.
64956496

64966497
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
64976498

6498-
The complexity is linear; there are (`last` - `first`) comparisons for equality.
6499+
The complexity is linear. It makes (`last` - `first`) comparisons for equality.
64996500

65006501
The [`list` class](list-class.md) has a more efficient member function version of `remove`, which also relinks pointers.
65016502

@@ -6604,7 +6605,7 @@ The order of the elements not removed remains stable.
66046605

66056606
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
66066607

6607-
The complexity is linear; there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments.
6608+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments.
66086609

66096610
### Example
66106611

@@ -6709,7 +6710,7 @@ The order of the elements not removed remains stable.
67096710

67106711
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
67116712

6712-
The complexity is linear: there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments.
6713+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments.
67136714

67146715
For information on how these functions behave, see [Checked Iterators](checked-iterators.md).
67156716

@@ -6817,7 +6818,7 @@ The order of the elements not removed remains stable.
68176818

68186819
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
68196820

6820-
The complexity is linear: there are (`last` - `first`) comparisons for equality.
6821+
The complexity is linear. It makes (`last` - `first`) comparisons for equality.
68216822

68226823
List has a more efficient member function version of remove which relinks pointers.
68236824

@@ -6927,7 +6928,7 @@ The order of the elements not replaced remains stable.
69276928

69286929
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
69296930

6930-
The complexity is linear; there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
6931+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
69316932

69326933
### Example
69336934

@@ -7030,7 +7031,7 @@ The order of the elements not replaced remains stable.
70307031

70317032
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
70327033

7033-
The complexity is linear: there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
7034+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
70347035

70357036
### Example
70367037

@@ -7154,7 +7155,7 @@ The order of the elements not replaced remains stable.
71547155

71557156
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
71567157

7157-
The complexity is linear; there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
7158+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
71587159

71597160
### Example
71607161

@@ -7281,7 +7282,7 @@ The algorithm `replace_if` is a generalization of the algorithm `replace`, allow
72817282

72827283
The `operator==` used to determine the equality between elements must impose an equivalence relation between its operands.
72837284

7284-
The complexity is linear: there are (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
7285+
The complexity is linear. It makes (`last` - `first`) comparisons for equality and at most (`last` - `first`) assignments of new values.
72857286

72867287
### Example
72877288

@@ -7540,7 +7541,7 @@ A forward iterator addressing the position one past the final element in the ran
75407541

75417542
The ranges referenced must be valid; all pointers must be dereferenceable and within the sequence the last position is reachable from the first by incrementation.
75427543

7543-
The complexity is linear with at most (`last` - `first`) swaps.
7544+
The complexity is linear. It makes at most (`last` - `first`) swaps.
75447545

75457546
### Example
75467547

@@ -7663,7 +7664,7 @@ An output iterator addressing the position one past the final element in the des
76637664

76647665
The ranges referenced must be valid; all pointers must be dereferenceable and within the sequence the last position is reachable from the first by incrementation.
76657666

7666-
The complexity is linear with at most (`last` - `first`) swaps.
7667+
The complexity is linear. It makes at most (`last` - `first`) swaps.
76677668

76687669
### Example
76697670

@@ -9382,7 +9383,7 @@ The range referenced must be valid; all pointers must be dereferenceable and wit
93829383

93839384
Elements are equivalent, but not necessarily equal, if neither is less than the other. The `sort` algorithm is stable and guarantees that the relative ordering of equivalent elements will be preserved.
93849385

9385-
The run-time complexity of `stable_sort` depends on the amount of memory available, but the best case (given sufficient memory) is `O(N log N)` and the worst case is `O(N (log N)^2)`, where *N* = *`last`* - *`first`*. Usually, the `sort` algorithm is significantly faster than `stable_sort`.
9386+
The run-time complexity of `stable_sort` depends on the amount of memory available, but the best case (given sufficient memory) is `O(N log N)` and the worst case is `O(N (log N)^2)`, where *N* = *`last`* - *`first`*. Usually, the `sort` algorithm is faster than `stable_sort`.
93869387

93879388
### Example
93889389

@@ -9706,7 +9707,7 @@ The ranges referenced must be valid; all pointers must be dereferenceable and wi
97069707

97079708
If *result* is set equal to *`first1`* in the first version of the algorithm, then the source and destination ranges will be the same and the sequence will be modified in place. But the *`result`* may not address a position within the range [`first1` + 1, `last1`).
97089709

9709-
The complexity is linear with at most (`last1` - `first1`) comparisons.
9710+
The complexity is linear. It makes at most (`last1` - `first1`) comparisons.
97109711

97119712
### Example
97129713

docs/standard-library/allocator-base-class.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
description: "Learn more about: allocator_base Class"
33
title: "allocator_base Class"
4-
ms.date: "11/04/2016"
4+
ms.date: 06/07/2022
55
f1_keywords: ["allocators/stdext::allocator_base", "allocators/stdext::allocators::allocator_base", "allocators/stdext::allocator_base::const_pointer", "allocators/stdext::allocator_base::const_reference", "allocators/stdext::allocator_base::difference_type", "allocators/stdext::allocator_base::pointer", "allocators/stdext::allocator_base::reference", "allocators/stdext::allocator_base::size_type", "allocators/stdext::allocator_base::value_type", "allocators/stdext::allocator_base::_Charalloc", "allocators/stdext::allocator_base::_Chardealloc", "allocators/stdext::allocator_base::address", "allocators/stdext::allocator_base::allocate", "allocators/stdext::allocator_base::construct", "allocators/stdext::allocator_base::deallocate", "allocators/stdext::allocator_base::destroy", "allocators/stdext::allocator_base::max_size"]
66
helpviewer_keywords: ["stdext::allocator_base [C++]", "stdext::allocators [C++], allocator_base", "stdext::allocator_base [C++], const_pointer", "stdext::allocator_base [C++], const_reference", "stdext::allocator_base [C++], difference_type", "stdext::allocator_base [C++], pointer", "stdext::allocator_base [C++], reference", "stdext::allocator_base [C++], size_type", "stdext::allocator_base [C++], value_type", "stdext::allocator_base [C++], _Charalloc", "stdext::allocator_base [C++], _Chardealloc", "stdext::allocator_base [C++], address", "stdext::allocator_base [C++], allocate", "stdext::allocator_base [C++], construct", "stdext::allocator_base [C++], deallocate", "stdext::allocator_base [C++], destroy", "stdext::allocator_base [C++], max_size"]
77
ms.assetid: f920b45f-2a88-4bb0-8ead-b6126b426ed4
8+
ms.custom: devdivchpfy22
89
---
910
# allocator_base Class
1011

@@ -81,7 +82,7 @@ A pointer to the allocated object.
8182

8283
### Remarks
8384

84-
This member function is used by containers when compiled with a compiler that cannot compile rebind. It implements `_Charalloc` for the user-defined allocator by returning the result of a call to the `allocate` function of the synchronization filter.
85+
This member function is used by containers when compiled with a compiler that can't compile rebind. It implements `_Charalloc` for the user-defined allocator by returning the result of a call to the `allocate` function of the synchronization filter.
8586

8687
## <a name="chardealloc"></a> allocator_base::_Chardealloc
8788

@@ -101,7 +102,7 @@ The number of objects to be deallocated from storage.
101102
102103
### Remarks
103104
104-
This member function is used by containers when compiled with a compiler that cannot compile rebind. It implements `_Chardealloc` for the user-defined allocator by calling the `deallocate` function of the synchronization filter. The pointer ptr must have been earlier returned by a call to `_Charalloc` for an allocator object that compares equal to **`*this`**, allocating an array object of the same size and type. `_Chardealloc` never throws an exception.
105+
This member function is used by containers when compiled with a compiler that can't compile rebind. It implements `_Chardealloc` for the user-defined allocator by calling the `deallocate` function of the synchronization filter. The pointer ptr must have been earlier returned by a call to `_Charalloc` for an allocator object that compares equal to **`*this`**, allocating an array object of the same size and type. `_Chardealloc` never throws an exception.
105106
106107
## <a name="address"></a> allocator_base::address
107108

0 commit comments

Comments
 (0)