摘要:
lower_bound&upper_bound是二分查找的一种版本,在已排序的区间中寻找可插入value的第一个位置和第一个不小于value的位置。lower_bound的实现(forward_iteratror版本,其random_access_iterator版本不需要用distance函数,直接用+):template<classForwardIterator,classT,classDistance>ForwardIterator__lower_bound(ForwardIteratorfirst,ForwardIteratorlast,constT&val 阅读全文