boost :: unordered_map的boost :: serialization

时间:2022-09-09 08:54:27

I've moved one of my member variables from a std::map to a boost::unordered_map for the performance benefits on insertion. However, this has broken my use of boost serialization for export/importing from an archive.

我已将我的一个成员变量从std :: map移动到boost :: unordered_map,以获得插入时的性能优势。但是,这已经破坏了我对从归档导出/导入的boost序列化的使用。

I've tried looking but can't find it anyway, I was wondering if there was a header I could include that would provide serialization to this class?

我试过看但无论如何都找不到它,我想知道是否有一个我可以包含的标题可以为这个类提供序列化?

Many thanks.

非常感谢。

2 个解决方案

#1


10  

Have a look at unordered_map_serialization.h in my distributed opening book learning project. It should be what you're looking for.

在我的分布式开放式学习项目中查看unordered_map_serialization.h。它应该是你正在寻找的。

#2


2  

I saw someone replaced map with unordered_map in serialization/map.hpp and this worked

我看到有人用serialization / map.hpp中的unordered_map替换了map,这很有效

#1


10  

Have a look at unordered_map_serialization.h in my distributed opening book learning project. It should be what you're looking for.

在我的分布式开放式学习项目中查看unordered_map_serialization.h。它应该是你正在寻找的。

#2


2  

I saw someone replaced map with unordered_map in serialization/map.hpp and this worked

我看到有人用serialization / map.hpp中的unordered_map替换了map,这很有效