I can't understand how to use boost::flyweight
as a GOF pattern. Is there are exist example somewhere?
For example, I expect it usage in the following way. There must be some flyweight container, that consist the "fat" objects. This container can give some lightweight "holder/descriptor" for some object. And I can store the descriptor in some container.
I can't understand how to receive the "holder/descriptor" of object from the boost::flyweight
.
A pattern implementation does not need to map 1:1 to the original pattern description. That's a good thing, since one can make use of the language features not available in the whatever set of features GoF were using, to make that implementation more performant, less verbose, more maintainable, and so on, and so on.
The
boost::flyweight
is the "lightweight holder/descriptor":