1

I have been using the cereal c++ library to (de)serialize several structs/classes in my codebase. Following is one such example:

struct MnodeInfo {
 uint64_t node;
 int prefix_id;

 MnodeInfo()=default;

 template<class Archive>

 void serialize(Archive & archive)
 {
   archive(node, prefix_id);
 }
};

This worked fine until I had to change the uint64_t to type unsigned __int128(using gcc). Now I get following error:

error: static assertion failed: cereal could not find any input serialization functions for the provided type and archive combination.

Is there a workaround for this issue? Can cereal be used to (de)serialize non-POD datatypes?

I did consider the using the Boost Multiprecision library (boost/multiprecision/cpp_int.hpp) and corresponding serialization support, however was curious if there were alternative approaches that cereal offered that could help solve this particular issue.

PGOnTheGo
  • 805
  • 1
  • 11
  • 25

0 Answers0