QT方面的开发
源代码在线查看: stl-function-adaptor.cc.svn-base
// Filename: STL-function-adaptor.cc // Use of the function adaptor bind2nd #include #include #include #include using namespace std; template void display(Iter fst, Iter lst, const char* ttl) { cout while ( fst != lst) cout cout } int main() { int data[3] = { 9, 10, 11}; display(data, data + 3, "Original values"); transform(data, data + 3, data, bind2nd(multiplies(), 2)); display(data, data + 3, "New values"); } /*out OOP> gpp STL-function-adaptor.cc OOP> a.out Original values 9 10 11 New values 18 20 22 OOP> */