### hwangganzi's blog

By hwangganzi, history, 3 weeks ago, , I want to find a pair that both first and the second value are bigger than s.lower_bound({a,b})

for example ~~~~ set<pair<int,int>> s; s.insert({50, 40}); s.insert({100, 20}); s.insert({120, 80}); auto it = s.lower_bound({80 , 60 }); ~~~~ if I do like this, iterator will find pair({100,20}). But What I want is pair ({120, 80}) because both first and the second value are bigger than ({80, 60}). for ({100, 20}) the first value is bigger than 80 but the second value is smaller than 60. This is not what I want. Sorry for my bad english, Thank you in advance. Comments (7)
 » a set can't do that because the order you describe is not a total order.
•  » » I think using lower_bound at max 2 times will work .You can see my comment below and tell me if I am wrong .
 » 3 weeks ago, # | ← Rev. 4 →   Edit : I was wrong .
•  » » add the entries {100, 21}, {100, 22}, ... , {100, 1000000000}...
•  » » » Thanks I got the mistake .
•  » » » » Thank you nice try though
•  » » » Thanks i got it