Various C++ code snippets