|
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 |
Answered by
greg7mdp
Jan 30, 2022
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 |
0 replies
Answer selected by
greg7mdp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @afshinpir, thanks for the question. Because std::atomic is not movable, you won't be able to use use it in
flathash maps (where the values are moved when the map resizes), but you should be able to use them in phmap'snodehash map, for example inphmap::node_hash_map.