Creating a new function from the existing functions at runtime

Now let's make a new function at runtime from the preexisting functions. Let's suppose we have two collections of functions, the first is hyperbolic functions and the second is the inverse of the first one. Beside these built-in functions, we also add one user-defined function to calculate the squared number in the first collection and the inverse of the squared number in the second collection. Then, we will implement the function composition and build a new function from two existing functions.

Function composition is a process to combine two or more simple functions to create a more complex one. The result of each function is passed as the argument to the next function. The ...

Get Learning C++ Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.