Hello. Let’s say I have a multiset with elements, 1 2 3 5 8. If I do
#include <iostream>
#include <set>
using namespace std;
int main(){
multiset<int> towers;
towers.insert(1);
towers.insert(5);
towers.insert(2);
towers.insert(3);
towers.insert(8);
auto it = towers.upper_bound(7);
if (it == towers.end())
cout << 1 << endl;
}
It outputs 1. How does it output 1 if .end() refers to the element after the last?