fork download
  1. class MyVectorInt
  2. {
  3. public:
  4.  
  5. struct Iterator
  6. {
  7. int operator*() const;
  8. void operator++();
  9. void operator++(int);
  10. bool operator == (const Iterator&) const;
  11. bool operator != (const Iterator&) const;
  12. };
  13.  
  14.  
  15. Iterator begin() const;
  16. Iterator end() const;
  17. };
  18.  
  19. int main()
  20. {
  21. for (auto&& e : MyVectorInt())
  22. {
  23. int&& rr = e;
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:23:19: error: cannot bind ‘int’ lvalue to ‘int&&’
        int&& rr = e;
                   ^
stdout
Standard output is empty