Observer design pattern in C++

No, but Boost.Signals2 gives you something similar.


As far as my knowledge goes in C++, STL doesn't have an implementation for Observer pattern. There was a proposal for Signal/Slot for standard library in TR2 though.

There are plenty of libraries which provides implementation for Observer pattern Qt library being one of the pioneers. The boost library has an implementation (see Boost::Signals & Boost::Signals2).

The Poco C++ library has a neat implementation of the observer pattern (see NotificationCenter).

libsigc++, cpp-events are some of the other libraries that provide signal/slot implementations.


No it doesn't. The C++ STL is much smaller than Java's Standard Library. If you are looking for something to expand on the STL that is supported by almost everything, it would be worth taking a look at the Boost libraries. In this case you may want to look at Boost.Signals which provides a signal/slot model.