如果我想加载相对较大的
最佳答案
是的,如果您有一系列按 value_comp()
顺序排列的对,则可以使用 the 4th overload
template< class InputIt >
map(InputIt first, InputIt last);
如果序列按 value_comp()
顺序排序,则需要花费线性时间。
关于c++ - std::map 插入顺序和性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75531144/