functional programming in cpp.