Boost logo

Boost Users :

Subject: [Boost-users] Generic Properties and serializable boost::any.
From: Mauricio Gomes (mgpensar_at_[hidden])
Date: 2010-02-15 14:48:40


Dear All,

Googling the subject I see there were some discussion about the subject
sometime ago.

Does anybody has implemented a serializable version (in the sense of the
boost serialization library) of boost::any ?

If you do, would you mind sharing it ?

I want to implement a generic Property class. I have taken a look at
Property Tree but that requires an homogeneous container (it requires to
pass the data type in the constructor template parameter. I would like to
pass only the key type and use boost::any to store the values.
However I need it to be serializable. I am learning generic programming and
I am a bit out of my league here so I would like to check if anybody has
already ventured in making boost::any serializable before I try it myself.

The goal would be to get something that would give me functionality similar
to get<T>(key) as we can find in Property Tree but requiring the data type
in a set<T>(key) method instead of asking for it in the constructor.
Does it make sense ? Am I in the right path using boost::any ? Is it even
possible in C++ ?

Thank you for your attention,

-- 
Mau


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net