Advertisement
yaffar

Untitled

Mar 31st, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. class Set {
  2.     private:
  3.         std::vector<int> _vec;
  4.         int _evens;                
  5.     public:
  6.         Set();
  7.         void putIn(int e);
  8.         void deleteItem(int e);
  9.         bool isEmpty() const {return _vec.size == 0;};
  10.         bool isIn(int e) const;
  11.         int getEvens() const;
  12.         void print() const;
  13.         friend std::ostream& operator<< (std::ostream& s, const Set& a);
  14. };
  15.  
  16. std::ostream& operator<< (std::ostream& s, const Set& a) {
  17.     for(int i = 0; i < a._vec.size() - 1; i++){
  18.         s << a._vec[i] << " ";
  19.     }
  20.     s << std::endl;
  21.     return s;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement