Skip to content

Instantly share code, notes, and snippets.

View caiwan's full-sized avatar
🐺

Caiwan caiwan

🐺
View GitHub Profile
@caiwan
caiwan / pub_sub_cpp.cpp
Created June 9, 2018 08:51 — forked from makomweb/pub_sub_cpp.cpp
Fun with C++: implementing a pub/sub scenario using std::bind and other standard facilities. The approach is pretty similar to the well known .NET event mechanism.
#include <iostream>
#include <map>
#include <algorithm>
#include <functional>
#include <memory>
using namespace std;
class EventArgs {
public: