阅读背景:

带有提示的std :: unordered_map插入

来源:互联网 

std::map has an insert method that takes a "hint" iterator that will reduce the insertion time from log(n) to constant time if the hint is correct. Its pretty obvious how this would work, since the container could just make sure the newly added item has a key that is less than the hint and has a key that is greater than the item before the hint. Otherwise the hint was wrong and it performs a normal insert. method that takes a "hin




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: