Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2008-02-03 18:29:30

Hello Robert,

----- Mensaje original -----
De: Robert Ramey <ramey_at_[hidden]>
Fecha: Domingo, Febrero 3, 2008 8:01 pm
Asunto: [boost] question about flyweight
Para: boost_at_[hidden]

> I've spent a tiny amount of time looking over the flyweight
> documentation and some code and I have a couple minor observations
> along with a really dumb question.
> a) when I see boost::flyweight::flyweights it confuses me. I
> suppose its no big deal.

It's boost::flyweights::flyweight, actually. The reason for
the spurious ess is explained at:

> b) I'm curious about the serialization implementation. Why didn't
> you choose just to serialize the factory? This seems to me the most
> obvious implementation and I wonder why you didn't feel it was
> a good choice.
> In short, I don't see why a "helper" is required.

Details aside, it all boils down to this:

  ar << f.h;

This only works off the shelf if f.h is a pointer, which is not
the case in general (the type of this handle is provided
by the particular factory used, and need not be a pointer,
for instance in set_factroy is a std::set::iterator).
Briefly put, the serialization helper used by flyweight mimics
for handle_type the tracking facilities Boost.Serialization
provides natively for pointers.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Boost list run by bdawes at, gregod at, cpdaniel at, john at