Example C++ implementations for design patterns