A lot of different screens in my app refer to the same entity/business objects over and over again.
Currently, each screen refers to their own copy of each object.
Also, entity objects may themselves expose access to other entity objects, again new copies of objects are created.
I'm trying to find a caching solution.
I'm looking for something similar to boost::flyweight.
However, based on immutable key/mutable value and reference counted.
boost::flyweight<key_value<long, SomeObject>, tag<SomeObject> > object;
The above is almost perfect. I'm looking for a similar container that will give mutable access to SomeObject
Edit: I like the flyweight's syntax and semantics. However, flyweight only allows const SomeObject& access, no chance to modify the object.
Edit2: Code has to compile on MSVC++6
Any ideas?