File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
content/cpp/concepts/unordered-set/terms/end Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change 1+ ---
12Title : ' end()'
2- Description: 'Returns an iterator that points to the past-the-end position of the unordered set or the end position in a specific bucket .'
3+ Description : ' Returns an iterator pointing just past the last element of the unordered set, marking the end of the container’s range .'
34Subjects :
45 - ' Code Foundations'
56 - ' Computer Science'
@@ -20,6 +21,10 @@ The **`end()`** method returns an iterator that points to the past-the-end posit
2021unordered_set_name.end();
2122```
2223
24+ ** Parameters:**
25+
26+ The ` end() ` function takes no parameters.
27+
2328** Return value:**
2429
2530Returns an ` iterator ` pointing to the past-the-end position of the ` unordered_set ` .
@@ -40,7 +45,7 @@ A `local_iterator` pointing to the past-the-end position in bucket `n`. If the b
4045
4146## Example
4247
43- This example shows iterating over an ` unordered_set ` using ` begin() ` and ` end() ` :
48+ In this example, iteration runs from ` begin() ` to ` end() ` to print every element in the ` unordered_set ` :
4449
4550``` cpp
4651#include < iostream>
@@ -67,7 +72,7 @@ A sample output might be:
677215
6873```
6974
70- > ** Note:** The iterator returned by ` end() ` marks the boundary for iteration and cannot be dereferenced .
75+ > ** Note:** The output order may vary because ` unordered_set ` does not store elements in any defined sequence .
7176
7277## Codebyte Example
7378
@@ -95,14 +100,3 @@ int main() {
95100 return 0;
96101}
97102```
98-
99- A sample output might be:
100-
101- ``` shell
102- Elements in bucket 0:
103- cat
104- dog
105- lion
106- ```
107-
108- Exact elements shown depend on the hash function and bucket count; your output may differ.
You can’t perform that action at this time.
0 commit comments