Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _COUNT_ITERATOR_H_
- #define _COUNT_ITERATOR_H_
- template<class T>
- class count_iterator
- {
- private:
- int _count;
- public:
- count_iterator() : _count(0) {}
- count_iterator& operator*() { return *this; }
- count_iterator& operator++() { return *this; }
- count_iterator& operator=(const T& v) { _count++; return *this; }
- int count() const { return count; }
- };
- #endif // _COUNT_ITERATOR_H_
Add Comment
Please, Sign In to add comment