Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class Evt>
- class Multicast{
- public:
- void addObserver(Observer<Evt>&& obs){
- observers.push_back(std::move(obs));
- }
- void broadcast(Evt event){
- for ( auto& obs : observers ){
- obs.observe(event);
- }
- }
- private:
- std::vector< Observer<Evt> > observers;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement