Function adaptor for combining function objects. More...
#include <unary_compose.h>
Public Member Functions | |
unary_compose (UnaryFunction1 ufn1, UnaryFunction2 ufn2) | |
UnaryFunction1::result_type | operator() (const typename UnaryFunction2::argument_type &x) |
Function adaptor for combining function objects.
I got this function adaptor from the STL documentation, because it doesn't seem to be present in recent versions of GCC.
What it does is that if you call it with two unary functions "x1( X )" and "x2( Y )", this function object evaluates internally as
x1( x2( X ) )
This can be a very useful thing to have when using the STL functionals and algorithms.