Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2006-05-24 15:46:36


Thanks Robert, that was it! I haven't made it to the Rational section,
so far. But I will, promised. ;-))

This probably has been discussed a million times, already. But, is it
possible to change the line 36 in collections_save_imp.hpp from

    unsigned int count = s.size();

to

   size_t count = s.size();

My compiler, VC 7.1 is going crazy and spits out a warning of 100 lines !!!

Thanks,
Christian

On 5/24/06, Robert Ramey <ramey_at_[hidden]> wrote:
> This is explainined in the section - "rationale" in the documentation.
> The following changes would make it work;
>
> Christian Henning wrote:
> > Hi there, I was just toying around with the boost serialization lib.
> > Unfortunately I have a problem with serializing a map. Here is what I
> > did:
> >
> > #include <map>
> > #include <string>
> > #include <iostream>
> > #include <algorithm>
> > #include <fstream>
> >
> > #include <boost/archive/text_iarchive.hpp>
> > #include <boost/archive/text_oarchive.hpp>
> > #include <boost/serialization/map.hpp>
> >
> > using namespace std;
> >
> > struct Settings
> > {
> > int Brightness;
> > int Contrast;
> > };
> >
> >
> > // Table indexed by strings
> > typedef pair< string, string > Key;
> > typedef map< Key, Settings* > Table;
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > Table aTable;
> >
> > aTable[ make_pair("Mueller","Meier") ] = new Settings();
> > aTable[ make_pair("Meier","Mueller") ] = new Settings();
> > aTable[ make_pair("Meier","Meier") ] = new Settings();
> >
> > Settings* pSettings = aTable[ make_pair("Mueller","Meier") ];
> > pSettings->Brightness = 99;
> > pSettings->Contrast = 8;
> >
> {
> const Table & stable = aTable;
> > ofstream ofs( "Settings.txt" );
> > boost::archive::text_oarchive oa( ofs );
> > oa << sTable;
> }
> >
> > return 0;
> > }
> >
>
> Robert Ramey
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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