C++ (Qt)class changes_emitter : public QObject{ Q_OBJECTpublic: void send(unit const&) { emit unit_changed(u); }signals: void unit_changed(unit const&);};
C++ (Qt)template<typename Unit>class editor_impl : public editor{public: // <...> void send_changes(unit const& u) { changes_emitter_.send(u); } // <...>private: changes_emitter changes_emitter_;};