Some common C++ snippets