functional programming with C++