Share via


binder1st

binder1st

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

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