Improved C++ snippets