Binh Van Pham
Binh Van Pham

Reputation: 123

Boost ability to save an unordered_map to disk

I have an unordered_map below that I would like to save to disk. The problem is my unordered_map contain pointer to my custom class. Would you please show me an example how to accomplish this?

boost::unordered_map<char*,boost::variant<macro*,module*>,myhash,cmp_str> *_REF;

Upvotes: 0

Views: 1795

Answers (1)

Dmitri Bouianov
Dmitri Bouianov

Reputation: 538

You need some kind of serialization mechanism for saving the contents of the map to the disk. I would recommend looking at Boost Serialization library for this purpose:

http://www.boost.org/libs/serialization/

Hope this helps.

Upvotes: 1

Related Questions