zyearn commented on pull request #1504:
URL: https://github.com/apache/incubator-brpc/pull/1504#issuecomment-894508814


   > 他那段应该说的是插入已存在对象的时候,已经具名的对象。emplace是否总是优于insert是理论上的,实践上不一定。
   > 
   > 
但是前文提到如果是针对需要插入并构造新对象的时候,emplace是比insert高效的,因为emplace是传入的构造参数列表,它原地构造对象。而insert是构造临时对象,最后再move过去,然后析构临时对象。emplace没有创建和析构临时对象的开销。
   > 
   > 我这里修改的都是构造了临时pair对象的地方
   
   好的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to