Name
binder2nd class template — Binds a value to the second argument of a binary function
Synopsis
template <typename Operation> class binder2nd : public unary_function< typename Operation::first_argument_type, typename Operation::result_type> { protected: Operation op; typename Operation::second_argument_type value; public: binder2nd(const Operation& x, const typename Operation::second_argument_type& y); typename Operation::result_type operator( ) (const typename Operation::first_argument_type& x) const; };
The binder2nd
class
template is a unary functional that binds a fixed value as the
second argument to a binary function object. The constructor
initializes the op
and value
data members with the x
and y
arguments. The operator( )
member
function returns op(x
, value)
.
See the bind2nd
function
template for an easier way to construct and use the binder2nd
class template.
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.