
in "fast array serialization (10x speedup)" On Tue, Nov 15, 2005 at 08:07:03PM +0100, Matthias Troyer wrote:
I actually have a portable binary archive based on XDR format, but it works only on UNIX operating systems, and that's why I have not submitted it to Boost.
We need a couple tweaks yet, no? I have a very plain portable binary archive around that I'd like to submit, it depends on: Matthias Troyer wrote way back in that thread:
3. I had to introduce a new strong typedef in basic_archive.hpp:
BOOST_STRONG_TYPEDEF(std::size_t, container_size_type) BOOST_CLASS_IMPLEMENTATION(boost::archive::container_size_type, primitive_type)
I remember that you suggested in the past that this should be done anyways. One reason is that using unsigned int for the size of a container, as you do it now will not work on platforms with 32 bit int and 64 bit std::size_t : the size of a container can be more than 2^32. I don't always want to serialize std::size_t as the integer chosen by the specific implementation either, since that would again not be portable. By introducing a strong typedef, the archive implementation can decide how to serialize the size of a container.
The further modifications to the library in
boost/serialization/collections_load_imp.hpp boost/serialization/collections_save_imp.hpp boost/serialization/vector.hpp
were to change the collection serialization to use the container_size_type.
[snip]
4. boost/archive/basic_binary_[io]archive.hpp serialize container_size_type as an unsigned int as done till now. It might be better to bump the file version and serialize them as std::size_t.
Can we go ahead with these bits? -t