Boost logo

Boost Users :

From: ben.carlyle_at_[hidden]
Date: 2007-08-02 01:02:56


I tried to raise a bug with trac, but my request was rejected as possible
spam. I am currently using the 1.32.0 boost library, but would like to get
away from it. One of the main features I am using is boost::serialization.
There are some problems with serialization in 1.32.0, in particular that
shared_ptr needs to have the "serialization" header included before the
real header. The mechanim for handling serialization of shared_ptr is also
a problem. Bitset support is also missing.

I was hoping to pick up 1.34.0, and have since also made an attempt to use
1.34.1. However, both of these revision appear to have regressions against
the 1.32.0 versions. Here is the first bug report I attempted to submit

== bug 1: boost/serialization/optional doesn't include necessary headers
==

The following function refers to version<T>::value without an include of
boost/serialization/version.hpp, resulting in user code that won't
compile. It is possible to work around this problem by including
boost/serialization/version.hpp before including
boost/serialization/optional.hpp. I did not require a work-around with
boost 1.32.0, but both 1.34.0 and 1.34.1 appear to need the work-around.

{{{
template<class Archive, class T>
void save(
    Archive & ar,
    const boost::optional<T> & t,
    const unsigned int /*version*/
)
}}}

== bug 2: Archive headers missing multiple(?) include files ==

Here is my test program:

#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>

int main(void)
{
        return 0;
}

Here are the first few lines of gcc output:

../boost/boost/boost/archive/basic_binary_iprimitive.hpp:72: error: ISO
C++ forbids declaration of ‘scoped_ptr’ with no type
../boost/boost/boost/archive/basic_binary_iprimitive.hpp:72: error:
invalid use of ‘::’
../boost/boost/boost/archive/basic_binary_iprimitive.hpp:72: error:
expected ‘;’ before ‘<’ token
../boost/boost/boost/archive/basic_binary_iprimitive.hpp:73: error: ISO
C++ forbids declaration of ‘basic_streambuf_locale_saver’ with no type
../boost/boost/boost/archive/basic_binary_iprimitive.hpp:73: error:
expected ‘;’ before ‘<’ token
../boost/boost/boost/archive/basic_binary_iprimitive.hpp: In member
function ‘void
boost::archive::boost::archive::basic_binary_iprimitive<Archive, Elem, Tr>
::load_binary(void*, size_t)’:
../boost/boost/boost/archive/basic_binary_iprimitive.hpp:150: error:
‘throw_exception’ is not a member of ‘boost::archive::boost’

It looks to my untrained eye that there could be several includes missing,
or perhaps some circular including going on.

==

This second bug hits pretty early in my build process, so I would not be
surprised if there were additional problems down the line. I am using an
ubuntu 7.04 distribution, gcc 4.1.2, etc.

Benjamin.


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