Boost logo

Boost Users :

Subject: Re: [Boost-users] list serialization with boost
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2012-11-22 12:13:24


2012/11/22 Olivier Austina <olivier.austina_at_[hidden]>

> Hello,
> I am a newbie of boost and I want to use it. I would like to serialize a
> list. The list is defined with the following data type:
>
> typedef struct person {
> char *name;
> char *first_name;
> struct person *next;
> } person;
>
> person *list_person;
>

I'd suggest reorganizing your struct into struct person { std::string
first_name; } and useing std::list<person> list. Then serializing and other
operations would probably be trivial.

But this does not answer your question if you can't change struct person.
Can you?

HTH,
Kris



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