Patterns in cpp