|
Boost Users : |
From: Pavlo Korzhyk (pavlo.korzhyk_at_[hidden])
Date: 2007-05-03 17:24:34
....
> "The macro BOOST_CLASS_EXPORT_GUID associates a string literal with a
> class. In the above example we've used a string rendering of the class
> name. If a object of such an "exported" class is serialized through a
> pointer and is otherwise unregistered, the "export" string is included
> in the archive. When the archive is later read, the string literal is
> used to find the class which should be created by the serialization
> library. ****This permits each class to be in a separate header file
> along with its string identifier****. There is no need to maintain a
....
> Is the document misleading here, or have I missed something??
It says that the class declaration may be placed in a separate header,
but that doesn't mean BOOST_CLASS_EXPORT_GUID must be placed
to that header too :)
When you create a separate header for the class, usually you also create
a separate .cpp for it. Place BOOST_CLASS_EXPORT there and everything
will work fine.
WBR, Pavlo Korzhyk
ICQ#155870780
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