Как сериализовать unique_ptrв структуре - PullRequest
0 голосов
/ 11 июня 2019

Мне не удалось найти никаких документов о том, как сериализовать unique_ptr в массив.Любая помощь будет великолепна.

struct Counter{
  int index;
  unique_ptr<char []> name;

    template<class Archive>
    void serialize(Archive & archive){
        archive(index, name ); // serialize things by passing them to the archive
    }
};

Как она назначена.

auto buffer = std::unique_ptr<char[]>(new char[BUFFER_SIZE]);
instance.name = std::move(buffer);
...