-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumping and Loading Nested Maps/Sets #44
Comments
Hi Adam, Maybe you could dump it as:
and do the opposite when reading (read size, call reserve, and then read n [k, v] pairs and populate the dict). Let me think about the multimap question. greg |
That worked great! Here is the code that I ended up implementing for people in the future:
Notice that I had to remove the Adam |
Nice. I'll do the const change and add this as an example.
|
I added the example dump_nested.cc. Thanks! - greg |
Hi @greg7mdp It seems that the example in https://github.com/greg7mdp/parallel-hashmap/blob/master/examples/dump_nested.cc is not working anymore to dump TriviallyCopyable types. |
Thanks for the note, @mr-eyes , I'll have a look this weekend. |
@mr-eyes sorry for that, I fixed the issue and even made the example nicer :-) |
@greg7mdp Thank you so much! |
@mr-eyes - thank you! It is always great to hear from happy users. |
@mr-eyes if you are using c++20, you may want to switch to the gtl library, it has all the stuff from phmap and more. |
Hi, I've been following this library for a while now, and although I haven't used it, I'm glad it exists, thanks for the great work! However I was unaware of the existence of the gtl library instead. Based on your comment, could you confirm that it is an updated superset of the phpmap library, with the only limitation of requiring compatibility with c++20? Thank you very much! DJuego |
yes, exactly! |
Hey Greg,
I would like to make an unordered unique multimap
phmap::flat_hash_map<Key, phmap::flat_hash_set<Value>>
whereKey
andValue
are trivially copyable. As one would expect when I try to dump the outer map usingphmap::BinaryOutputArchive ar_out( filename.c_str() ); dict.dump( ar_out );
I get an error that the inner set is not trivially copyable.What would you suggest for serializing?
Also, side question: Is this how you would make a multimap?
Thanks,
Adam
The text was updated successfully, but these errors were encountered: