some c++ snippets