Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-01-22 11:53:58


Vladimir Prus wrote:

>IOW, it's required that archives to be used with exported classes
>are included before you do BOOST_EXPORT? Indeed, when I add

IOW?

> #include <boost/archive/text_oarchive.hpp>

>everything starts to work. I guess I've no problem with this solution --
>since I don't know how else EXPORT would work.

>But it's unfortunate to get assert like above -- newbie will immediately
>decide it's a bug in serialization library. OTOH, requiring that all archive
>headers are included before BOOST_CLASS_EXPORT is probably overkill.

It would be worse than overkill - it would mean that code gets instanticated
for all archives whether or not they are used. Code bloat. This way I
managed to get the right code and only the right code instantiated.

>But it's unfortunate to get assert like above -- newbie will immediately
>decide it's a bug in serialization library. OTOH, requiring that all archive
>headers are included before BOOST_CLASS_EXPORT is probably overkill.

Better would be to use #pragma error <msg> but AFAIK its only supported
by microsoft compilers and definately not portable. Even so I'm inclined
to include for conditionally for compilers that support it. Hmmmm
another great ideat BOOST_COMPILE_TIME_ERROR_MESSAGE(message)
for someone who's got nothing else to do. Hmmm - great idea
could implement for compilers that support and STATIC_ASSERT for
everything else.

Robert Ramey


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