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