hi,
i am looking for a function in STL that does this job:
say, i have a map with elements a,b,d,e, and their values are 10,20, 30,40 respectively.
i want a method, that gives me 20(or the position of "b") when i enter "c". i mean it finds the biggest element that has a key smaller than or equal to "c".
another example
a,b,c,d, and their values are 10,20, 30,40
i want position of c, or 30; when i enter c
another one:
a,b,c,d, and their values are 10,20, 30,40
i want position of d, or 40; when i enter e
i think lower_bound, upper_bound may work out but i couldnt get them work. can you help me please?
thanks