Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-01-23 11:28:31


Vladimir Prus wrote:

>If, you plan to use both, consider:

> class B { public: virtual ~B() {} };
> class D1 : public B {};
> class D2 : public B {};
> class D3 : public B {};
> BOOST_CLASS_EXPORT(B);
> BOOST_CLASS_EXPORT(D1);
> BOOST_CLASS_EXPORT(D2);
> BOOST_CLASS_EXPORT(D3);

>Suppose you're writing all those classes. Under current semantics, you'll
>have strings "D1", "D2" and "D3" written to archive at some point, once.
>With my proposal, "B" will also be written to archive, once. Is *that*
>really important performance-wise?

I don't believe that's true. I'm pretty sure that under your proposal
(in your previous example) the archive would need to contain
all the strings "D1", "D2", and "D3"

I think a better answer would be that if efficiency were of such
prime importance forward registration using ar.template register
would be used as it requires no strings at all. this "forward
registration" relies on syncronization of save and load
to match the class invoked durring save to a the class
to be invoked during load.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk