对于std::tr1::unordered_map,是否存在类似于std::map::lower_bound的等效std

Is there any equivalent std::algorithm similar to std::map::lower_bound for std::tr1::unordered_map?

本文关键字:std map lower bound 类似于 tr1 unordered 对于 是否 存在      更新时间:2023-10-16

对于std::tr1::unordered_map,是否存在类似于std::map::lower_bound的等价std::算法?

没有,因为std::unordered_map不是一个有序容器。

std::lower_bound存在,但它只适用于有序容器:

要求: [first,last)e元素应根据表达式e < valuecomp(e, value)进行分区。

C + + 11,(低。绑定)(§25.4.3.1)