#ifndef MUDUO_BASE_SIGNALSLOTTRIVIAL_H #define MUDUO_BASE_SIGNALSLOTTRIVIAL_H #include #include template class SignalTrivial; template class SignalTrivial { public: typedef std::function Functor; void connect(Functor&& func) { functors_.push_back(std::forward(func)); } void call(ARGS&&... args) { // gcc 4.6 supports //for (const Functor& f: functors_) typename std::vector::iterator it = functors_.begin(); for (; it != functors_.end(); ++it) { (*it)(args...); } } private: std::vector functors_; }; #endif // MUDUO_BASE_SIGNALSLOTTRIVIAL_H