Share via


binder2nd

binder2nd

template<class Pred>
    class binder2nd
        : public unary_function<Pred::first_argument_type,
            Pred::result_type> {
public:
    binder2nd(const Pred& pr, const Pred::second_argument_type y);
    result_type operator()(const argument_type& x) const;
protected:
    Pred op;
    Pred::second_argument_type value;
    };

The template class stores a copy of pr, which must be a binary function object, in op, and a copy of y in value. It defines its member function operator() as returning op(x, value).