#include #include #include //#include //#include "bullshit.h" #include "stack" void ProcessMessage(const std::string& message) { std::cout << "Received: " << message << std::endl; } // TODO: BasicEvent tests here. int main() { BasicEvent, std::string> OnMessage; BasicEvent> VoidDelegate; bool run = true; auto handler = OnMessage += [&] (const std::string& message) { std::cout << "GOTS A MESSAGE: " << message << std::endl; }; auto handler2 = OnMessage += ProcessMessage; auto handler3 = OnMessage += [&] { std::cout << "Connect to event, with default callback, if we don't care about using the provided arguments." << std::endl; }; while (run) { std::string input; std::cin >> input; OnMessage.Invoke(input); VoidDelegate.Invoke(); OnMessage(input); VoidDelegate(); } return 0; } #ifdef _WIN32 extern "C" { int wmain(int argc, wchar_t* argv[]) { return main(); } } #endif