fork download
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. std::list<int> List;
  6.  
  7. int main() {
  8. List.push_back(1);
  9. List.push_back(2);
  10. List.push_back(3);
  11. //
  12. auto q = List.rbegin();
  13. //
  14. {
  15. // сюда нет доступа
  16. List.push_back(4);
  17. List.push_back(5);
  18. List.push_back(6);
  19. }
  20. //
  21. auto qq = q;
  22. //std::cout << ( qq == List.end()) << '\n';
  23. std::cout << *qq << '\n';
  24. return 0;
  25. }
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
6