bind2nd2.cpp

bind2nd2.cpp

#include ‹iostream.h›

#include ‹stl.h›

int array[3] = {1, 2, 3};

int main() {

 replace_if(array, array + 3, bind2nd(greater‹int (), 2), 4);

 for (int i = 0; i ‹ 3; i++) cout ‹‹ array[i] ‹‹ endl;

 return 0;

}