Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/special.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,17 @@ <h3><a name="export">Exporting Class Serialization</a></h3>
<code style="white-space: normal">BOOST_CLASS_EXPORT_IMPLEMENT</code>
in the class definition file.

<p>
This makes the rule easy to follow but does not remove it. The definition
file has to include the archive class headers itself, before
<code style="white-space: normal">BOOST_CLASS_EXPORT_IMPLEMENT</code>
is invoked, just as it would for
<code style="white-space: normal">BOOST_CLASS_EXPORT</code>.
A definition file which includes none of them instantiates no serialization
code at all, and serializing a pointer to such a class then throws
<code style="white-space: normal">unregistered_class</code>
when the program is run.

<p>
This system has certain implications for placing code in static or shared
libraries. Placing <code style="white-space: normal">BOOST_CLASS_EXPORT</code>
Expand Down
7 changes: 5 additions & 2 deletions doc/traits.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ <h3><a name="export">Export Key</a></h3>
This is addressed by invoking
<code style="white-space: normal">BOOST_CLASS_EXPORT_IMPLEMENT(T)</code>
in the file which defines (implements) the class T.
This ensures that code for the derived class T will
be explicitly instantiated.
That instantiates the code for the archive classes whose headers the file
includes, so the file has to include them before the macro is invoked.
See
<a href="special.html#export">Exporting Class Serialization</a>
for the details, and for what happens when it includes none of them.
<li> There needs to be some sort of identifier which can
be used to select the code to be invoked when the object
is loaded.
Expand Down