c++ STL地图在创建后移动一个值的位置?
我在这里和那里阅读了一些提示,即将对象插入C ++ STL映射后,只要一个不删除它,它在内存中的位置就永远不会更改。但是没有人提到任何文献或来源来支持它,所以我不知道这种提示有多可靠。谁能确定/可靠地回答这个问题?可以依赖实施吗?有保证吗?
I have read some hints here and there that after inserting an object into a c++ stl map, then as long as one doesn't delete it, its location in memory never changes. But nobody ever mentioned any literature or sources to back it up, so I don't know how reliable such hints are. Can anyone answer this definately/reliably? Could it be implementation-dependent? Is there a guarantee anywhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不。
您可以依靠它。
它不能取决于实施。
是的,它可以在C ++标准中保证:
No.
You can rely on it.
It couldn't be dependent on implementation.
Yes, it is guaranteed in the C++ standard: