plus |
A binary function object that returns the sum of its two operands.
+ y .
#include <iostream>
#include <functional>
#include <numeric>
int input1[ 4 ] = { 1, 6, 11, 8 };
int input2[ 4 ] = { 1, 5, 2, 3 };
void
main()
{
int total = inner_product
(
input1,
input1 + 4,
input2,
0,
plus< int >(),
times< int >()
);
cout << "total = " << total << "\n";
}
total = 77
Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.