Binary Search in STL- 02

Would it be able to give if the frequency of occurrences if elements 40 is not present linearly using (upper bound-lower bound)