C++11: std::function and std::bind

std::function and std::bind were born inside the Boost C++ Library, but they were incorporated into the new C++11 standard. std::function is a STL template class that provides a very convenient wrapper to a simple function, to a functor or to a lambda expression. For example, if you want to store several functions, functors or lambda… Continue reading C++11: std::function and std::bind

Advertisements

C++11: C++-style listener list

Consider you want to create a class where you can register a set of listeners to be notified when something occurs. For example, this is a class that performs some task and you want to be notified when the task has been completely executed. See this code in Java: How would you implement it in… Continue reading C++11: C++-style listener list