Serialize a vector of lists with boost

Hi all.
I have a program, simplified as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <vector>
#include <list>
#include <fstream>

using namespace std;

class MyObj
{
	int val;

	public:
	MyObj(int v){ val = v; };
	~MyObj(){};
};

int main (int argc, char *argv[])
{
	int i, j;
	vector< list<MyObj*> > layers;

	for(i=0; i<5; i++)
	{
		list<MyObj*> tmp;

		for(j=0; j<10; j++)
			tmp.push_back( new MyObj(j) );
		
		layers.push_back(tmp);
	}
	return 0;
}


I need to serialize/deserialize the object "layers".

Can anyone give me an example on how to do this with boost serialization library?

Thanks in advance.
Last edited on
Topic archived. No new replies allowed.