Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-01-12 17:59:19


Try putting it in either the namespace of std::map<MarkId, Mark> (ie std) or
in the
namespace boost::serialization

Robert Ramey

Peter Whaite wrote:
> Robert Ramey <ramey_at_[hidden]> wrote:
>> Which version of boost are you using? I believe this may have come
>> up and been addressed in 1_33_1?
>
> Now that spirit is fixed I have tried again on the CVS (1_34).
> Unfortunately I now have a different error -- it prefers the serialize
> template over my serialize function?
>
> #include <map>
> #include <fstream>
> #include <boost/archive/xml_wiarchive.hpp>
> #include <boost/serialization/utility.hpp> // For std::pair
>
> struct Mark {};
> enum MarkId {low,median,high};
> typedef std::map<MarkId,Mark> MarkMap;
>
> void serialize(boost::archive::xml_wiarchive & ar, MarkMap & m,
> const unsigned int version) {
> MarkMap::iterator it;
> for (it = m.begin() ; it != m.end(); ++it) {
> ar & boost::serialization::make_nvp("item", *it);
> }
> }
>
> int main(int argc, char* argv[])
> {
> std::wifstream ifs;
> boost::archive::xml_wiarchive ar(ifs);
> MarkMap marks;
> ar & boost::serialization::make_nvp("marks",marks);
> }
>


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