boost unordered map in shared memory using std::string key

前端 未结 1 1459
一个人的身影
一个人的身影 2021-01-21 16:18

Is it possible to use std::string or other complex structure key type with boost unordered map on shared memory? If so, can I find some sample code? I found some sample code fo

相关标签:
1条回答
  • 2021-01-21 16:55

    Yes.

    You can see an example here:

    • Boost interprocess unordered_map compilation

    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

      Note that that answer concerns itself with ordered containers

    0 讨论(0)
提交回复
热议问题