Class binary_compose

Synopsis

#include <include/EASTL/functional.h>

template <class Operation1, class Operation2, class Operation3>
class binary_compose : public unary_function<typename Operation2::argument_type, typename Operation1::result_type>

Description

binary_compose

Inheritance

Ancestors: unary_function

Methods

binary_compose
operator() overload

Source

Lines 509-536 in include/EASTL/functional.h.

template <class Operation1, class Operation2, class Operation3>
class binary_compose : public unary_function<typename Operation2::argument_type, typename Operation1::result_type> 
{
protected:
    Operation1 op1;
    Operation2 op2;
    Operation3 op3;
public:
    // Support binary functors too.
    typedef typename Operation2::argument_type first_argument_type;
    typedef typename Operation3::argument_type second_argument_type;
    binary_compose(const Operation1& x, const Operation2& y, const Operation3& z) 
        : op1(x), op2(y), op3(z) { }
    typename Operation1::result_type operator()(const typename Operation2::argument_type& x) const 
        { return op1(op2(x),op3(x)); }
    typename Operation1::result_type operator()(typename Operation2::argument_type& x) const 
        { return op1(op2(x),op3(x)); }
    typename Operation1::result_type operator()(const typename Operation2::argument_type& x,const typename Operation3::argument_type& y) const 
        { return op1(op2(x),op3(y)); }
    typename Operation1::result_type operator()(typename Operation2::argument_type& x, typename Operation3::argument_type& y) const 
        { return op1(op2(x),op3(y)); }
};





Add Discussion as Guest

Log in