如何序列化的类型&lt名单变量;提高:: shared_ptr的<无效*>> [英] how do i serialize list variable of type <boost::shared_ptr<void *>>

查看:103
本文介绍了如何序列化的类型&lt名单变量;提高:: shared_ptr的<无效*>>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道如何序列化类型的boost :: shared_ptr的℃的列表变量;无效*> A类或结构内。一般来说,我会去与我们一般使用类似同样的方法

I'm really not sure how do i serialize a list variable of type boost::shared_ptr <void *> inside a class or struct. Generally, i would go with same method that we generally use like

struct A
{
    std::list<boost::shared_ptr<void *>> mdb;
}

template<class Archive>
void serialize(Archive &d,const unsigned int version)
{
      d & mdb;  // not sure that this would work
}

在编译时它不给错误,但我最终不序列。

while compiling it does not give error but does not serialize at my end.

推荐答案

您没有。在所有的可能性中,无效*

You don't. In all likelihood, the void* is


  • 的句柄(对于一些本地API);可以序列这仅在API已经足够识别信息来重建负载手柄

  • 对于其他的东西类型双关语(这将是愚蠢的,才有真正的类型存在,那么)

这篇关于如何序列化的类型&lt名单变量;提高:: shared_ptr的&LT;无效*&GT;&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆