binary_search — checks existence. lower_bound — finds position.
std::binary_search:
1std::vector<int> v = {1, 3, 5, 7, 9};2bool found = std::binary_search(v.begin(), v.end(), 5);3// true
std::lower_bound:
1auto it = std::lower_bound(v.begin(), v.end(), 5);2// Points to 534auto it2 = std::lower_bound(v.begin(), v.end(), 6);5// Points to 7 (first >= 6)
upper_bound:
equal_range: