Replies: 1 comment
-
Gah... my fault. Out of place parameter pack. Sorry for the distraction. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to serialize an STL map that stores a pointer to a struct and handle the pointer myself. The data that is pointed to will be handled elsewhere, such that I just need to save an index in place of the pointer, then on load, use that index to lookup the new address.
I can specialize around the default static_assert for my pointer type and can then specialize the save template in pair_associative_container.hpp such that the proper index is being stored for the key in the archive. (Essentially, it converts 1 to 2 and saves that.)
std::unordered_map< MyPtrType, MyData > myMap;
std::unordered_map< index, MyData > myMap;
However, I can't figure out how to make my load work.
It will compile and invoke my load specialization, but only when I comment out the map.emplace_hint. Otherwise, I get various compiler errors, the last of which is a static assert from cereal complaining about not finding a serialization function. The type that it seems to be complaining about is std::pair used in my (default) allocator.
I wouldn't expect needing a serialization function for the allocator. Hoping someone can help point me in the right direction here.
Attached are the gcc error log, my template specializations and the saved archive.
gcc.out.txt
cereal_types.h.txt
archive.txt
My invocations are standard stuff:
Beta Was this translation helpful? Give feedback.
All reactions