c++ example: Function object example 2