Suppose I have a set of values stored in std :: set:
{1, 2, 6, 8}
and I have a search key, say 3. I want to put 3 in a function and get the first value greater than or equal to 3, in which case I would like to get 6.
The find () function provided in map / set / multimap / will certainly return a final iterator for this case. Is there a similar search function that will return 6 in this case?
source
share