fork(86) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <iterator>
  4. #include <algorithm>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. std::vector<int> v { 0, 1, 2, 3, 4 };
  9. auto i = find(begin(v), end(v), 2);
  10.  
  11. std::cout << *i << std::endl;
  12.  
  13. std::reverse_iterator<decltype(i)> ri(i);
  14. std::cout << *ri << std::endl;
  15. }
  16.  
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
2
1