Boost logo

Boost Users :

Subject: Re: [Boost-users] Design for boost::serialization of STL iterators.
From: Kikazaru (spam_at_[hidden])
Date: 2009-05-23 05:36:40

This thread seems to be a bit old... but I also would like to serialize

Of course it would be possible to work around the lack of serialization for
iterators, but I'm not sure how to achieve this efficiently for BIG maps
where the whassit... data which isn't the key... is an iterator.

I tried writing the functions myself but I'm not sure how to get around:

/usr/include/boost/archive/detail/oserializer.hpp:564: error: invalid
application of ‘sizeof’ to incomplete type


[ yes, I did see the comments in the code about not trying to
serialize a "track_never" object through a pointer, nor saving a non-const
object which is not "track_never"... i.e., if you serialize a pointer it
must not be "track_never", but if you serialize a non-const object it must
be "track_never"... is that right? I think I might have to const_cast the
iterator data, but the funny thing is, my serialization functions raise this
static assertion even when they are nops. ]

Anyway, this seems like a really useful thing to have if you are using the
STL. I think it should be possible to do it non-intrusively... isn't there a
mighty boost guru somewhere to take up the challenge?

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at