Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1.  
  2. template<typename T>
  3. class Cos
  4. {
  5. private:
  6.     vector<T> chestii;
  7. public:
  8.     Cos() = default;
  9.     /*Cos(Cos<T>& ot)
  10.     {
  11.         chestii.size() = ot.size();
  12.         for (int i = 0; i < chestii.size(); i++)
  13.         {
  14.             chestii[i] = ot.chestii[i];
  15.         }
  16.     }*/
  17.     Cos& operator+(const T& elem)
  18.     {
  19.         chestii.pb(elem);
  20.         return *this;
  21.     }
  22.     Cos& undo()
  23.     {
  24.         chestii.erase(chestii.begin() + chestii.size()-1);
  25.         return *this;
  26.     }
  27.     void operator=(const Cos<T>& ot)
  28.     {
  29.         chestii = ot.chestii;
  30.     }
  31.     void tipareste(ostream& s)
  32.     {
  33.         for (unsigned int i = 0; i < chestii.size(); i++)
  34.             s << chestii[i]<<"  ";
  35.     }
  36.  
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement