+ struct NotifyeeBase
+ {
+ virtual ~NotifyeeBase() { }
+
+ virtual void notify(Collection &, const std::string &, T &) const = 0;
+ };
+
+ template<typename C>
+ struct Notifyee: NotifyeeBase
+ {
+ typedef void (C::*FuncPtr)(const std::string &, T &);
+
+ FuncPtr func;
+
+ Notifyee(FuncPtr f): func(f) { }
+
+ virtual void notify(Collection &coll, const std::string &name, T &item) const
+ { (dynamic_cast<C &>(coll).*func)(name, item); }
+ };
+