More c++ snippets