fork(1) download
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<int> is = { 1 };
  7. cout << "Before: " << is.at(0) << endl;
  8. iter_swap(is.begin(), is.end());
  9. cout << "After: " << is.at(0) << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
Before: 1
After:  0