adding the ptrs implementation of iterator incrementing

This commit is contained in:
Jidong Xiao
2025-03-24 17:45:05 -04:00
committed by JamesFlare
parent c9d4888ed6
commit d6e4a2cfae
4 changed files with 223 additions and 4 deletions

View File

@@ -8,8 +8,11 @@ int main() {
// insert some values into the set
numbers.insert(10);
numbers.insert(5);
numbers.insert(88);
numbers.insert(20);
numbers.insert(49);
numbers.insert(15);
numbers.insert(36);
numbers.insert(5); // Duplicate value (won't be inserted)
// print the elements of the set
@@ -27,5 +30,13 @@ int main() {
std::cout << value << " is not found in the set." << std::endl;
}
// check if a specific value exists in the set
value = 66;
if (numbers.find(value) != numbers.end()) {
std::cout << value << " is found in the set." << std::endl;
} else {
std::cout << value << " is not found in the set." << std::endl;
}
return 0;
}