Boost logo

Boost Users :

Subject: [Boost-users] [Serialization] Combination of templates and polymorphism
From: Michal Gregor (glorinand_at_[hidden])
Date: 2010-08-27 10:22:31

I am writing serialization for a template library I created. The problem is
that I cannot figure out how to serialize templates of polymorphic classes
(combination of polymorphism and templates).

Polymorphic classes generally need to be exported using BOOST_CLASS_EXPORT,
which however takes in a complete type so this would require me to register
all possible instantiations of the templates, which is not possible - I
don't know beforehand what instantiations might the library user make (I
would have to rely on the user of the library to do the work and there is no
way the user will even know which template classes may be instantiated
behind the scenes somewhere).

What I would like is a mechanism that would automagically register the class
upon instantiation. Any ideas?

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at