-
Hi I wonder what is the requirements for the key/value of these maps. For example, can I use them with a structure like this as value? struct S {
S(int i) : m_(i) {}
std::atomic<int> m_;
}; As you see, this structure is not copy/move constructible/assignable. I can use this with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @afshinpir, thanks for the question. Because std::atomic is not movable, you won't be able to use use it in |
Beta Was this translation helpful? Give feedback.
-
@greg7mdp Thanks for the info. |
Beta Was this translation helpful? Give feedback.
Hi @afshinpir, thanks for the question. Because std::atomic is not movable, you won't be able to use use it in
flat
hash maps (where the values are moved when the map resizes), but you should be able to use them in phmap'snode
hash map, for example inphmap::node_hash_map
.