Notice that this function returns an iterator to only one of the elements with that value; To obtain the entire range of elements with a given value, you can use multiset::equal_range.
Parameters
- x
- Value to be searched for.
key_type is a member type defined in multiset containers as an alias of Key, which is the first template parameter and the type of the elements stored in the container.
Return value
An iterator to one of the elements with that value, if such an element is found, or multiset::end if the specified value is not found in the container.iterator is a member type, defined in multiset as a bidirectional iterator type.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Output:
mymultiset contains: 10 30 50 |
Complexity
Logarithmic in size.See also
| multiset::equal_range | Get range of equal elements (public member function) |
| multiset::count | Count elements with a specific key (public member function) |
| multiset::lower_bound | Return iterator to lower bound (public member function) |
| multiset::upper_bound | Return iterator to upper bound (public member function) |
