Inhaltsverzeichnis

bind2nd()

#include <functional> (veraltet, statt dessen: bind())

template <class Op, class T> 
binder2nd<Op> bind2nd (const Op& op, const T& wert) 

Legt das zweite Argument eines zweistelligen Funktionsobjekts op auf den wert fest.

Parameter

op zweistelliger Funktionsadapter op(x,y)
wert zweites Argument für op(x, wert)

Ergebnis

Rückgabewert: einstelliger Funktor.

Siehe auch

bind(), bind1st(), ptr_fun().

Beispiel

bind2nd.cpp
#include <algorithm>
#include <functional>
#include <iostream>
 
int main()
{
  double arr[] = { 1, 2, 3, 4, 5 };
 
  std::cout << std::count_if(begin(arr), end(arr), std::bind2nd(std::less<double>(), 3)) << '\n';
  return 0;                                        // x < 3  
}