Patterns in C: template