onilink_

Untitled

Nov 4th, 2020
2,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. template<typename T>
  2. class SortedEntitiesPointers
  3. {
  4. public:
  5.     using vector = std::vector<od::not_null<T*>>;
  6.     using iterator = typename vector::iterator;
  7.     using const_iterator = typename vector::const_iterator;
  8.    
  9.     void add(od::not_null<T*> ptr);
  10.     void remove(od::not_null<T*> ptr);
  11.    
  12.     iterator begin() { return _t.begin(); }
  13.     iterator end() { return _t.begin(); }
  14.     const_iterator begin() const { return _t.begin(); }
  15.     const_iterator end() const { return _t.begin(); }
  16.    
  17.     const vector& data() const { return _t; }
  18.    
  19. private:
  20.     vector _t;
  21. };
Advertisement
Add Comment
Please, Sign In to add comment