// This is a simple example of the “negate” unary functor. #include #include #include #include using namespace std; int main() { int vals[] = {3,1,4,1,5,9}; transform(vals, vals+6, ostream_iterator(cout, ","), negate()); cout << '\n'; }