I'm trying to serialize and deserialize a sparsepp spp::sparse_hash_map
of type spp::sparse_hash_map<const std::vector<uint32_t>, uint32_t>
using cereal.
See related question on why I use a const
key here.
However, compilation of the following code fails:
spp::sparse_hash_map<const std::vector<uint32_t>, uint32_t> my_map;
std::ifstream file(path, std::ios::binary);
cereal::BinaryInputArchive input(file);
input(my_map);
When I remove const from the key type, it compiles:
spp::sparse_hash_map<std::vector<uint32_t>, uint32_t> my_map;
std::ifstream file(path, std::ios::binary);
cereal::BinaryInputArchive input(file);
input(my_map);
The output of the compiler:
error: no matching function for call to ‘cereal::BinaryInputArchive::processImpl(const std::vector<unsigned int>&)’
Compiler: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Is there a way to deserealize this type using cereal? What am I missing?