#include #include #include #include using namespace std; template class Add {private: type number; public: Add (type initv): number (initv) { CONST TYPE & OPERATOR () (Type & Elem) const {elem = number; returnide;}};
INT main () {list coll; for (INT i = 0; i <20; i) {coll.push_front (i); coll.push_back (i);} transform (Coll.begin (), Coll.end (), coll.begin (), add (10)); copy (coll.begin (), coll.end (), ostream_iterator (cout, ")); cout << Endl; for_each (coll.begin (), coll.end (), add (2)), copy (coll.begin (), coll.end (), ostream_iterator (cout, ")) COUT << Endl; cin.get (); return 0;}