Examples of patterns and idioms in C++