Does boost support serialization of c++11's std::tuple?

∥☆過路亽.° 提交于 2019-12-08 14:53:54

问题


Does boost support serialization of c++11's std::tuple?

I couldn't find a tuple.hpp header file at /boost/serialization/

I'm using boost 1.52.0 (happy to upgrade if need be, but it seems like the changes in version 1.53 doesn't have anything related to this).


回答1:


Out of the box, no. You'll have to write the serializer yourself. Luckily, someone already did:

C++0x tuple boost serialization (also in github)




回答2:


and here is another implementation:

https://github.com/galaxyeye/atlas/blob/master/atlas/serialization/tuple.h

with the test code :

https://github.com/galaxyeye/atlas/blob/master/libs/serialization/test/tuple.cpp

enjoy :)



来源:https://stackoverflow.com/questions/14744303/does-boost-support-serialization-of-c11s-stdtuple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!