Say I have the following code
#include <iostream>
#include <set>
int main ()
{
std::set<int> myset;
int inf, sup;
inf = 25; sup = 60;
for (int i=1; i<10; i++) myset.insert(i*10);
return 0;
}
I was trying to find out if the standard library provides any methods or a combination of methods that would allow me to get two iterators it_l, it_uto cover the range [inf, sup]. I tried using lower_bound, upper_bound, but I misunderstood how they work. The idea would be to not write loops (because I know that I can write my own function for this task, but maybe there is an alternative that I don't know about).
Update: some examples of expected output will be (in my example)
inf =25; sup = 60 I expect {30,40,50,60}
if instead
inf=30; sup = 60 I expect {30,40,50,60}
if
inf=25; sup = 65 I expect {30,40,50,60}
-, , , , , .
inf sup, . , , [inf, sup] , . - , , ?
A={10 20 30 40 50 60 70 80 90}, B1=[25,60], B2=[30,60] B3=[25,65]
i=1,2,3 A Bi , .