#pragma once #include #include template class Notification{ public: typedef std::function HandlerTy; Notification() = default; void onNotify(HandlerTy aHandler); void notify(notifyData... notifySendData); private: std::vector mFunctionHandlers; }; template void Notification::onNotify(HandlerTy aHandler){ mFunctionHandlers.push_back(std::move(aHandler)); } template void Notification::notify(outboundData... notifySendData){ for (auto handler : mFunctionHandlers){ handler(notifySendData...); } }