2
4

1 回答 1

1

As far as I understand the way this library works, there is no way to deserialize something that doesn't have a default constructor at least for dynamically allocated objects.

The logic under this is the following:

  1. You need to deserialize vector<Node>
  2. In order to do that you need to allocate an appropriate amount of memory
  3. cereal doesn't know about the constructor and can't properly allocate object memory by itself
  4. In order to provide a proper object building it requires the default constructor
于 2017-05-07T17:26:43.963 回答