Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Export question
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-04-08 13:55:32


On Wed, Apr 8, 2009 at 8:12 AM, Tom Aylesworth
<taylesworth_at_[hidden]> wrote:
> So at this point, I wonder, why bother with the EXPORT macro at all?  Given
> that the class has to be registered with the archive, why not just use
> register_type when the archive is created?

The convenience of BOOST_CLASS_EXPORT is that it is automatic, the
primary use case is to just include a module in your project and
voila, it auto-registers all its classes for serialization.

However, BOOST_CLASS_EXPORT is not portable, in this primary use case
the compiler is allowed to deadstrip it, though it contains some
trickery to prevent this from happening.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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