Function adaptor for combining function objects. More...
#include <binary_compose.h>
Public Member Functions | |
binary_compose (BinaryFunction bfn, UnaryFunction1 ufn1, UnaryFunction2 ufn2) | |
BinaryFunction::result_type | operator() (const typename UnaryFunction1::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 a binary function "bfn( X, Y )", and two unary functions "x1( X )" and "x2( X )", then internally it will evaluate as
bfn( x1( X ), x2( X ) )
The concept may be a bit tricky, but have a look at the STL documentation...
This class is not actually used by the code anymore, but I didn't just want to throw it out, as it might come handy later on.