
joaquin@tid.es ha scritto:
Alberto Ganesh Barbati escribió:
4) I don't understand why you need Value to be Assignable. I believe it's really important that you could support non-Copiable and non-Assignable value types. The main reason for using flyweight is precisely to avoid having more copies of the value than the strictly necessary. If you are going to copy values, you are failing this requirement.
For key-value flyweights, Value is *not* required to be assignable or copy constructible, *except* if assignment or construction from value is attempted:
flyweight<key_value<key_type,value_type> > fw; value_type v; fw=v; // for this to work value_type must be assignable.
(See also http://tinyurl.com/create.php )
I see. That is very good. However you should correct the documentation, because it now says clearly in key_value.html: "Let Key be a type with some implicit equivalence relationship and Value an Assignable type constructible from Key." HTH, Ganesh