Skip to content

Commit 59e138d

Browse files
Tyler WhitneyTyler Whitney
authored andcommitted
tech review
1 parent 2f85b7c commit 59e138d

8 files changed

Lines changed: 53 additions & 53 deletions

‎docs/standard-library/map-class.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "map Class"
33
description: "API reference for the C++ Standard Template Library (STL) `map` class, which is used for the storage and retrieval of data from a collection in which each element is a pair that has both a data value and a sort key."
4-
ms.date: "9/9/2020"
4+
ms.date: "9/10/2020"
55
f1_keywords: ["map/std::map", "map/std::map::allocator_type", "map/std::map::const_iterator", "map/std::map::const_pointer", "map/std::map::const_reference", "map/std::map::const_reverse_iterator", "map/std::map::difference_type", "map/std::map::iterator", "map/std::map::key_compare", "map/std::map::key_type", "map/std::map::mapped_type", "map/std::map::pointer", "map/std::map::reference", "map/std::map::reverse_iterator", "map/std::map::size_type", "map/std::map::value_type", "map/std::map::at", "map/std::map::begin", "map/std::map::cbegin", "map/std::map::cend", "map/std::map::clear", "map/std::map::count", "map/std::map::contains", "map/std::map::crbegin", "map/std::map::crend", "map/std::map::emplace", "map/std::map::emplace_hint", "map/std::map::empty", "map/std::map::end", "map/std::map::equal_range", "map/std::map::erase", "map/std::map::find", "map/std::map::get_allocator", "map/std::map::insert", "map/std::map::key_comp", "map/std::map::lower_bound", "map/std::map::max_size", "map/std::map::rbegin", "map/std::map::rend", "map/std::map::size", "map/std::map::swap", "map/std::map::upper_bound", "map/std::map::value_comp"]
66
helpviewer_keywords: ["std::map [C++]", "std::map [C++], allocator_type", "std::map [C++], const_iterator", "std::map [C++], const_pointer", "std::map [C++], const_reference", "std::map [C++], const_reverse_iterator", "std::map [C++], difference_type", "std::map [C++], iterator", "std::map [C++], key_compare", "std::map [C++], key_type", "std::map [C++], mapped_type", "std::map [C++], pointer", "std::map [C++], reference", "std::map [C++], reverse_iterator", "std::map [C++], size_type", "std::map [C++], value_type", "std::map [C++], at", "std::map [C++], begin", "std::map [C++], cbegin", "std::map [C++], cend", "std::map [C++], clear", "std::map [C++], count", "std::map [C++], contains", "std::map [C++], crbegin", "std::map [C++], crend", "std::map [C++], emplace", "std::map [C++], emplace_hint", "std::map [C++], empty", "std::map [C++], end", "std::map [C++], equal_range", "std::map [C++], erase", "std::map [C++], find", "std::map [C++], get_allocator", "std::map [C++], insert", "std::map [C++], key_comp", "std::map [C++], lower_bound", "std::map [C++], max_size", "std::map [C++], rbegin", "std::map [C++], rend", "std::map [C++], size", "std::map [C++], swap", "std::map [C++], upper_bound", "std::map [C++], value_comp"]
77
ms.assetid: 7876f4c9-ebb4-4878-af1e-09364c43af0a
@@ -104,7 +104,7 @@ The map orders the elements it controls by calling a stored function object of t
104104
|[cbegin](#cbegin)|Returns a const iterator that points to the first element in the `map`.|
105105
|[cend](#cend)|Returns a const past-the-end iterator.|
106106
|[clear](#clear)|Erases all the elements of a `map`.|
107-
|[contains](#contains)|Checks if there's an element with the specified key in the `map`.|
107+
|[contains](#contains)<sup>C++20</sup>|Check if there's an element with the specified key in the `map`.|
108108
|[count](#count)|Returns the number of elements in a map whose key matches the key specified in a parameter.|
109109
|[crbegin](#crbegin)|Returns a const iterator that points to the first element in a reversed `map`.|
110110
|[crend](#crend)|Returns a const iterator that points to the location after the last element in a reversed `map`.|
@@ -530,11 +530,11 @@ The number of elements in m1 with a sort key of 3 is: 0.
530530

531531
## <a name="contains"></a> contains
532532

533-
Checks if there's an element the specified key in the `map`.
533+
Checks if there's an element with the specified key in the `map`.
534534

535535
```cpp
536-
[[nodiscard]] bool contains(const K& key) const;
537-
template<class K> [[nodiscard]] bool contains(const K& key) const;
536+
bool contains(const Key& key) const;
537+
template<class K> bool contains(const K& key) const;
538538
```
539539
540540
### Parameters
@@ -551,16 +551,18 @@ The element's key value to look for.
551551
552552
### Remarks
553553
554-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
554+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
555555
556-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
556+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
557557
558558
### Example
559559
560560
```cpp
561561
// Requires /std:c++latest
562562
#include <map>
563+
#include <string>
563564
#include <iostream>
565+
#include <functional>
564566
565567
int main()
566568
{

‎docs/standard-library/multimap-class.md‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ In C++14 you can enable heterogeneous lookup by specifying the `std::less<>` or
9898
|[cbegin](#cbegin)|Returns a const iterator addressing the first element in the `multimap`.|
9999
|[cend](#cend)|Returns a const iterator that addresses the location succeeding the last element in a `multimap`.|
100100
|[clear](#clear)|Erases all the elements of a `multimap`.|
101-
|[contains](#contains)|Checks if there is an element with the specified key in the `multimap`.|
101+
|[contains](#contains)<sup>C++20</sup>|Checks if there is an element with the specified key in the `multimap`.|
102102
|[count](#count)|Returns the number of elements in a `multimap` whose key matches a parameter-specified key.|
103103
|[crbegin](#crbegin)|Returns a const iterator addressing the first element in a reversed `multimap`.|
104104
|[crend](#crend)|Returns a const iterator that addresses the location succeeding the last element in a reversed `multimap`.|
@@ -121,8 +121,6 @@ In C++14 you can enable heterogeneous lookup by specifying the `std::less<>` or
121121
|[upper_bound](#upper_bound)|Returns an iterator to the first element in a `multimap` that with a key that is greater than a specified key.|
122122
|[value_comp](#value_comp)|The member function returns a function object that determines the order of elements in a `multimap` by comparing their key values.|
123123
124-
### Operators
125-
126124
|Operator|Description|
127125
|-|-|
128126
|[operator=](#op_eq)|Replaces the elements of a `multimap` with a copy of another `multimap`.|
@@ -410,11 +408,11 @@ See the example for [rend](#rend) for an example of how to declare and use `cons
410408

411409
## <a name="contains"></a> multimap::contains
412410

413-
Checks if there is an element the specified key in the `multimap` .
411+
Checks if there is an element with the specified key in the `multimap` .
414412

415413
```cpp
416-
[[nodiscard]] bool contains(const K& key) const;
417-
template<class K> [[nodiscard]] bool contains(const K& key) const;
414+
bool contains(const Key& key) const;
415+
template<class K> bool contains(const K& key) const;
418416
```
419417
420418
### Parameters
@@ -431,9 +429,9 @@ The element's key value to look for.
431429
432430
### Remarks
433431
434-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
432+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
435433
436-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
434+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
437435
438436
### Example
439437

‎docs/standard-library/multiset-class.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ In C++14, you can enable heterogeneous lookup by specifying the `std::less<>` or
9090
|[cbegin](#cbegin)|Returns a const iterator that addresses the first element in the `multiset`.|
9191
|[cend](#cend)|Returns a const iterator that addresses the location succeeding the last element in a `multiset`.|
9292
|[clear](#clear)|Erases all the elements of a `multiset`.|
93-
|[contains](#contains)|Checks if there's an element with the specified key in the `multiset`.|
93+
|[contains](#contains)<sup>C++20</sup>|Check if there's an element with the specified key in the `multiset`.|
9494
|[count](#count)|Returns the number of elements in a `multiset` whose key matches the key specified as a parameter.|
9595
|[crbegin](#crbegin)|Returns a const iterator addressing the first element in a reversed `multiset`.|
9696
|[crend](#crend)|Returns a const iterator that addresses the location succeeding the last element in a reversed `multiset`.|
@@ -377,11 +377,11 @@ See the example for [rend](#rend) for an example of how to declare and use the `
377377

378378
## <a name="contains"></a> multiset::contains
379379

380-
Checks if there's an element the specified key in the `multiset` .
380+
Checks if there's an element with the specified key in the `multiset` .
381381

382382
```cpp
383-
[[nodiscard]] bool contains(const K& key) const;
384-
template<class K> [[nodiscard]] bool contains(const K& key) const;
383+
bool contains(const Key& key) const;
384+
template<class K> bool contains(const K& key) const;
385385
```
386386
387387
### Parameters
@@ -398,9 +398,9 @@ The element's key value to look for.
398398
399399
### Remarks
400400
401-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
401+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
402402
403-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
403+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
404404
405405
### Example
406406

‎docs/standard-library/set-class.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The iterator provided by the set class is a bidirectional iterator, but the clas
9090
|[cbegin](#cbegin)|Returns a const iterator that addresses the first element in the `set`.|
9191
|[cend](#cend)|Returns a const iterator that addresses the location succeeding the last element in a `set`.|
9292
|[clear](#clear)|Erases all the elements of a `set`.|
93-
|[contains](#contains)|Checks if there's an element with the specified key in the `set`.|
93+
|[contains](#contains)<sup>C++20</sup>|Check if there's an element with the specified key in the `set`.|
9494
|[count](#count)|Returns the number of elements in a `set` whose key matches a parameter-specified key.|
9595
|[crbegin](#rbegin)|Returns a const iterator addressing the first element in a reversed `set`.|
9696
|[crend](#rend)|Returns a const iterator that addresses the location succeeding the last element in a reversed `set`.|
@@ -377,11 +377,11 @@ See the example for [rend](#rend) for an example of how to declare and use the `
377377

378378
## <a name="contains"></a> contains
379379

380-
Checks if there's an element the specified key in the `set`.
380+
Checks if there's an element with the specified key in the `set`.
381381

382382
```cpp
383-
[[nodiscard]] bool contains(const K& key) const;
384-
template<class K> [[nodiscard]] bool contains(const K& key) const;
383+
bool contains(const Key& key) const;
384+
template<class K> bool contains(const K& key) const;
385385
```
386386
387387
### Parameters
@@ -398,9 +398,9 @@ The element's key value to look for.
398398
399399
### Remarks
400400
401-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
401+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
402402
403-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
403+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
404404
405405
### Example
406406

‎docs/standard-library/unordered-map-class.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The allocator class.
7070
|[cend](#cend)|Designates the end of the controlled sequence.|
7171
|[clear](#clear)|Removes all elements.|
7272
|[count](#count)|Finds the number of elements matching a specified key.|
73-
|[contains](#contains)|Checks if there is an element with the specified key in the `unordered_map` .|
73+
|[contains](#contains)<sup>C++20</sup>|Check if there is an element with the specified key in the `unordered_map`.|
7474
|[emplace](#emplace)|Adds an element constructed in place.|
7575
|[emplace_hint](#emplace_hint)|Adds an element constructed in place, with hint.|
7676
|[empty](#empty)|Tests whether no elements are present.|
@@ -770,8 +770,8 @@ Checks if there is an element in the `unordered_map` with the specified key.
770770
Introduced in C++20.
771771

772772
```cpp
773-
[[nodiscard]] bool contains(const K& key) const;
774-
<class K> [[nodiscard]] bool contains(const K& key) const;
773+
bool contains(const Key& key) const;
774+
<class K> bool contains(const K& key) const;
775775
```
776776
777777
### Parameters
@@ -788,9 +788,9 @@ The key value of the element to look for.
788788
789789
### Remarks
790790
791-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
791+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
792792
793-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
793+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent.
794794
795795
### Example
796796

‎docs/standard-library/unordered-multimap-class.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "unordered_multimap Class"
3-
description: "API overview for the C++ Standard Library container class `multimap`."
3+
description: "API overview for the C++ Standard Library container class `unordered_multimap`."
44
ms.date: "9/9/2020"
55
f1_keywords: ["unordered_map/std::unordered_multimap", "unordered_map/std::unordered_multimap::allocator_type", "unordered_map/std::unordered_multimap::const_iterator", "unordered_map/std::unordered_multimap::const_local_iterator", "unordered_map/std::unordered_multimap::const_pointer", "unordered_map/std::unordered_multimap::const_reference", "unordered_map/std::unordered_multimap::difference_type", "unordered_map/std::unordered_multimap::hasher", "unordered_map/std::unordered_multimap::iterator", "unordered_map/std::unordered_multimap::key_equal", "unordered_map/std::unordered_multimap::key_type", "unordered_map/std::unordered_multimap::local_iterator", "unordered_map/std::unordered_multimap::mapped_type", "unordered_map/std::unordered_multimap::pointer", "unordered_map/std::unordered_multimap::reference", "unordered_map/std::unordered_multimap::size_type", "unordered_map/std::unordered_multimap::value_type", "unordered_map/std::unordered_multimap::begin", "unordered_map/std::unordered_multimap::bucket", "unordered_map/std::unordered_multimap::bucket_count", "unordered_map/std::unordered_multimap::bucket_size", "unordered_map/std::unordered_multimap::cbegin", "unordered_map/std::unordered_multimap::cend", "unordered_map/std::unordered_multimap::clear",
66
"unordered_map/std::unordered_multimap::contains", "unordered_map/std::unordered_multimap::count", "unordered_map/std::unordered_multimap::emplace", "unordered_map/std::unordered_multimap::emplace_hint", "unordered_map/std::unordered_multimap::empty", "unordered_map/std::unordered_multimap::end", "unordered_map/std::unordered_multimap::equal_range", "unordered_map/std::unordered_multimap::erase", "unordered_map/std::unordered_multimap::find", "unordered_map/std::unordered_multimap::get_allocator", "unordered_map/std::unordered_multimap::hash", "unordered_map/std::unordered_multimap::insert", "unordered_map/std::unordered_multimap::key_eq", "unordered_map/std::unordered_multimap::load_factor", "unordered_map/std::unordered_multimap::max_bucket_count", "unordered_map/std::unordered_multimap::max_load_factor", "unordered_map/std::unordered_multimap::max_size", "unordered_map/std::unordered_multimap::rehash", "unordered_map/std::unordered_multimap::size", "unordered_map/std::unordered_multimap::swap", "unordered_map/std::unordered_multimap::unordered_multimap", "unordered_map/std::unordered_multimap::operator=", "unordered_map/std::unordered_multimap::hash_function"]
@@ -71,7 +71,7 @@ The allocator class.
7171
|[cbegin](#cbegin)|Designates the beginning of the controlled sequence.|
7272
|[cend](#cend)|Designates the end of the controlled sequence.|
7373
|[clear](#clear)|Removes all elements.|
74-
|[contains](#contains)|Checks if there is an element with the specified key in the `unordered_multimap`.|
74+
|[contains](#contains)<sup>C++20</sup>|Checks if there is an element with the specified key in the `unordered_multimap`.|
7575
|[count](#count)|Finds the number of elements matching a specified key.|
7676
|[emplace](#emplace)|Adds an element constructed in place.|
7777
|[emplace_hint](#emplace_hint)|Adds an element constructed in place, with hint.|
@@ -722,11 +722,11 @@ int main()
722722

723723
## <a name="contains"></a> unordered_multimap::contains
724724

725-
Checks if there is an element the specified key in the `unordered_multimap`.
725+
Checks if there is an element with the specified key in the `unordered_multimap`.
726726

727727
```cpp
728-
[[nodiscard]] bool contains(const K& key) const;
729-
template<class K> [[nodiscard]] bool contains(const K& key) const;
728+
bool contains(const Key& key) const;
729+
template<class K> bool contains(const K& key) const;
730730
```
731731
732732
### Parameters
@@ -743,9 +743,9 @@ The element's key value to look for.
743743
744744
### Remarks
745745
746-
`Contains()` is new in C++20. To use it, specify the [std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
746+
`contains()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
747747
748-
`template<class K> [[nodiscard]] bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
748+
`template<class K> bool contains(const K& key) const` only participates in overload resolution if `key_compare` is transparent. See [Heterogeneous lookup in associative containers](https://docs.microsoft.com/cpp/standard-library/stl-containers#heterogeneous-lookup-in-associative-containers-c14) for more information.
749749
750750
### Example
751751

0 commit comments

Comments
 (0)