I want to "observe" changes to std::string and std::vector/std::map
structures. The idea being that whenever code modifies a string, or
adds/deletes a collection element, my code is notified so that I can
invalidate view objects, etc.
I know that I can wrap these data structures within my own classes and add
the observer hooks to my accessor routines. This is a tedious and
error-prone process for things like std::string with lots of methods.
I'm curious if others have found a good way to do this for STL strings and
containers. All my reading warns against sub-classing STL classes for lots
of good reasons. Are there alternatives?