#include <algorithm>
#include <numeric>
#include <vector>
std::vector<double> a = { 1., 2., 3., 4., 5., 6. };
std::vector<double> b = { 6., 4., 2., 5., 3., 1. };
std::vector<double> res(6);
std::transform(a.begin(), a.end(), res.begin(), std::negate());
// => res == { -1., -2., -3., -4., -5., -6. }
std::transform(a.begin(), a.end(), b.begin(), res.begin(), std::plus());
// => res == { 7., 6., 5., 9., 8., 7. };
using namespace std::placeholders;
int c = std::count_if(a.begin(), a.end(), std::bind(std::greater(), _1, 3.));
// c == 3