Is it possible to de-serialize a pickled file in C++

  boost, c++, deserialization, python, serialization

I have a custom class that I wish to serialize in python and later de-serialize in C++ for further operations. For this purpose, I have used Pickle over JSON since pickle supports serialization of custom classes.

Now I want to de-serialize this pickle file in C++. Usually, deserialization can be done via boost::serialization and boost::archive from boost library. But since .pkl files are python-specific, I’m not sure if a native binary archive like boost::archive::binary_iarchive will be able to deserialize the contents of the pickle file.

I should also mention that __getstate__() method of the custom class is essentially returning a python-dictionary, so will it be better if I try to serialize it with JSON rather than Pickle?

Source: Windows Questions C++