I am trying to use transform_reduce to transform a set of numbers and then reduce it to the maximum of those elements.
auto lambda = [](uint64_t x) {
return function(x);
};
counting_iterator<uint64_t> start(1);
counting_iterator<uint64_t> finish(bound);
auto max_val = *transform_reduce(start, finish, lambda, std::max_element(start, finish));
My logic is that it will change all the values from 1 to bound to function(1) to function(bound), then with those values, give me the largest, but I am having issues, can anyone help me get to want I want to achieve?