trait Listener { fn callback(&self); } struct Processor<'a> { listeners: Vec<&'a Listener> }
Run
struct Listener { virtual void callback() = 0; }; struct Processor { vector<Listener*> listeners; };