cpp: add range iteration snippet