13
votes

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.

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
seriously, how can boost dont have native support for serializing theyr own goddam containers? - Icebone1000
@Icebone1000 different libraries, written by different people... - TZHX

2 Answers

10
votes

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

2
votes

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