Boost logo

Boost :

Subject: Re: [boost] [flyweight] key value with objects not constructible from a key
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-11-12 16:32:19


On Wed, Nov 12, 2008 at 16:09, Joaquin M Lopez Munoz <joaquin_at_[hidden]> wrote:
>
> If an equivalent flyweight already exists then there is no
> problem, fw will be assigned the same texture object, this is
> how Boost.Flyweight currently works. Now, imagine that
> no equivalent texture exists, and yet you can't construct
> a texture object from "wood.texture" alone. How would you
> have then the above statement behave?
>

Perhaps there is no constructor for a texture that takes the
key, but instead there's some load_texture function that can
construct a texture from the key?

I didn't notice an easy way to include the opposite of an
extractor that can go from key to value, so it seems like
doing that would require wrapping a factory.


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