Skip to content

Document that the definition file needs the archive headers - #376

Merged
gennaroprota merged 1 commit into
developfrom
doc/definition-file-needs-the-archive-headers
Aug 13, 2026
Merged

Document that the definition file needs the archive headers#376
gennaroprota merged 1 commit into
developfrom
doc/definition-file-needs-the-archive-headers

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

BOOST_CLASS_EXPORT_IMPLEMENT instantiates serialization code only for the archive classes whose headers its translation unit has seen, so a definition file which includes none of them instantiates nothing, and serializing a pointer to the class throws unregistered_class at run time. The rule was stated for BOOST_CLASS_EXPORT, but both passages which send the reader to the _KEY and _IMPLEMENT pair presented that split as the answer to the include ordering problem without saying that the definition file still has to follow it.

Refs #327.

`BOOST_CLASS_EXPORT_IMPLEMENT` instantiates serialization code only for
the archive classes whose headers its translation unit has seen, so a
definition file which includes none of them instantiates nothing, and
serializing a pointer to the class throws `unregistered_class` at run
time.  The rule was stated for `BOOST_CLASS_EXPORT`, but both passages
which send the reader to the `_KEY` and `_IMPLEMENT` pair presented that
split as the answer to the include ordering problem without saying that
the definition file still has to follow it.

Refs #327.
@gennaroprota
gennaroprota added this pull request to the merge queue Aug 13, 2026
Merged via the queue into develop with commit e7ffcb6 Aug 13, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant