![[Dept of Engineering]](http://www.eng.cam.ac.uk/images/house_style/engban-s.gif)
<functional> supplies common conditions that can operate on various
types: e.g., greater_equal<int>(),
plus<double>(), logical_or<int>() etc. The following does
a vector multiplication
of a and b, putting the answer in res
to which elements are added one at a time.
void discount(vector<double>& a, vector<double>& b, vector<double>& res)
{
transform(a.begin(), a.end(), b.begin(), back_inserter(res), multiplies<double>());
// vector multiplication
}