c++ example: Generic Algorithm example