c++ example: Function object example 1