[英]boost unordered map in shared memory using std::string key
Is it possible to use std::string or other complex structure key type with boost unordered map on shared memory? 是否可以将std :: string或其他复杂结构键类型与共享内存上的boost无序映射一起使用? If so, can I find some sample code?
如果可以,我可以找到一些示例代码吗? I found some sample code for using unordered map on shared memory but were unable to change the key type to complex structure.
我发现了一些示例代码,用于在共享内存上使用无序映射,但是无法将密钥类型更改为复杂的结构。 Thanks
谢谢
Yes. 是。
You can see an example here: 您可以在此处查看示例:
You will want to watch the overhead when doing lookups. 查找时,您将需要注意开销。 Using non-standard key equality/hash functions can solve this:
使用非标准键相等性/哈希函数可以解决此问题:
want to efficiently overcome mismatch between key types in a map in Boost.Interprocess shared memory 想要有效地克服Boost.Interprocess共享内存中映射中的关键类型之间的不匹配
Note that that answer concerns itself with ordered containers 请注意,答案与订购容器有关
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.