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
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
#include #include 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users