Comments

As per my understanding, std::upper|lower_bound works best when forwarditerator, here box.begin(), is randomAccessIterator. Otherwise when it will try to find middle element, It has to traverse like queue from beginning iterator to middle element. => O(nlogn) complexity for finding one element, worse than linear search.

set/multiset's upper|lower_bound function is made to work efficiently with sets

You can refer Complexity Section from this post: http://www.cplusplus.com/reference/algorithm/upper_bound/