daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Vector
  2. {
  3.     vetor<int> p;
  4.     class Range
  5.     {
  6.         int index;
  7.         Range(int i) : index(i) {}
  8.     }
  9.     int& operator[] (int i)
  10.     {
  11.         if (i >= 0 && i < p.size()) return p[i];
  12.         throw Range(i);
  13.     }
  14. }
  15.  
  16.  
  17. //////////
  18.  
  19.  
  20.  
  21. try
  22. {
  23.     Vector vector;
  24.     vector[p.size() + 10]// ОШИБКА 100%
  25.    
  26. }
  27. catch (Vector::Range r)
  28. {
  29.     cout << "FAIL!!! NOT VALID ONDEX";
  30. }
RAW Paste Data
Top