fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <numeric>
  4. #include <functional>
  5.  
  6. int main()
  7. {
  8. std::vector<int> a {1, 2, 3};
  9. std::vector<int> b {1, 2, 3, 4};
  10. auto it = b.begin();
  11. typedef std::vector<int>::iterator ci;
  12. auto res = std::inner_product<ci,ci&,int>(a.begin(), a.end(), it, 0);
  13. std::cout << (void*)&*b.begin() << ' ' << (void*)&*it << '\n';
  14. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
0x9916018 0x9916024