Boost logo

Boost :

From: Kim Barrett (kab_at_[hidden])
Date: 2006-03-09 22:16:18


In boost 1.33.1, using gcc 3.3.5 (SuSE9.3 on x86 if it matters)

I've run into an include order problem with the serialization
library.

It seems that including <boost/serialization/nvp.hpp> before
including <boost/archive/polymorphic_iarchive.hpp> (or oarchive)
doesn't work. In a translation unit that does this and includes
an invocation of serialization, I get an error of the form:

   .../iserializer.hpp: In constructor
      `...iserializer<Archive, T>::iserializer()
   [with ARchive = polymorphic_archive, T = my_type]':
      ... lots of intermediate instantiations ...
   error: incomplete type
     boost::serialization::extended_type_info_null<my_type>
     cannot be used to name a scope

If nvp.hpp is included later (or not explicitly included at all,
since I see that polymorphic_iarchive.hpp includes it at the end of
its include block), all is well. A little more poking at it by
hoisting out the nested includes from nvp.hpp directly into my source
file found that including polymorphic_[io]archive.hpp before
type_info_implementation.hpp makes the problem go away too.

   nvp -> level -> traits -> type_info_implementation

I know Robert has fixed a bunch of include order issues, and I think
I recall that some of those fixes were post-1.33.1. Is this a known
one? Or is a reproducible test case needed? Or is this a real include
order dependency that one simply must avoid?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk