update some cpp snippets