|
-
October 26th, 2011, 04:24 AM
#1
Heterogeneous container
I'm faced with a problem.
I'd like to have something along the lines of a heterogeneous map class, eg:
Code:
heterogeneous_map map;
map.set<std::string>("name", "Chris");
map.set<int>("age", 23);
std::string name = map.get<std::string>("name");
int age = map.get<int>("age");
This isn't particularly hard to achieve with a std::map<std::string, boost::any>, the problem arises because I need to be able to serialize and de-serialize these heterogeneous maps. I'm using Boost::Serialization, which works very well for most things I've tried so far, but it has no support for serializing a boost::any object. What can I do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|