Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vector
- {
- vetor<int> p;
- class Range
- {
- int index;
- Range(int i) : index(i) {}
- }
- int& operator[] (int i)
- {
- if (i >= 0 && i < p.size()) return p[i];
- throw Range(i);
- }
- }
- //////////
- try
- {
- Vector vector;
- vector[p.size() + 10]// ОШИБКА 100%
- }
- catch (Vector::Range r)
- {
- cout << "FAIL!!! NOT VALID ONDEX";
- }
Add Comment
Please, Sign In to add comment