Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1.  
  2. #ifndef _COUNT_ITERATOR_H_
  3. #define _COUNT_ITERATOR_H_
  4.  
  5. template<class T>
  6. class count_iterator
  7. {
  8. private:
  9. int _count;
  10. public:
  11. count_iterator() : _count(0) {}
  12. count_iterator& operator*() { return *this; }
  13. count_iterator& operator++() { return *this; }
  14. count_iterator& operator=(const T& v) { _count++; return *this; }
  15.  
  16. int count() const { return count; }
  17. };
  18.  
  19. #endif // _COUNT_ITERATOR_H_
Add Comment
Please, Sign In to add comment