【问题标题】:How to deserialize and create objects on heap?如何反序列化和在堆上创建对象?
【发布时间】:2014-04-23 01:28:53
【问题描述】:

当对象包含时如何使用 boost (c++11) 序列化/反序列化对象

vector<map<u_int64_t, Student*>*>* students;

喜欢:

class  YearContainer{
public:
vector<map<u_int64_t, Student*>*>* students;

};

Student 类有序列化方法,如

template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
     ar & name;
     // ....
}

如何反序列化并在堆上创建所有内容?

【问题讨论】:

    标签: c++ c++11 boost


    【解决方案1】:

    这看起来像是使用了Boost.Serialization 库。我真的没有在这里看到更具体的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-28
      • 2011-04-06
      • 1970-01-01
      • 2012-05-24
      • 2021-04-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多