Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Iterator {//ili friend class
- T* dataP;
- public:
- Iterator(T* target) : dataP(target) {}
- bool operator != (const Iterator &other) const {
- return dataP != other.dataP;
- }
- bool operator ++(int) {
- dataP++;
- }
- bool operator * () const {
- }
- T operator* () const {
- return *dataP;
- }
- };
- //+proverki
- class ArrayContainer {
- Iterator begin() const;
- Iterator end() const;
- };
- template <typename T>
- typename ArrayContainer<T>::Iterator ArrayContainer<T>::begin() const {
- return Interator(array);
- }
- template <typename T>
- typename ArrayContainer<T>::Iterator ArrayContainer<T>::end() const {
- return Iterator(!array ? nullptr :array + size);
- }
- for (auto it = test.begin(); it != test.end(); i++) {
- std::cout << *it;
- }
- ArrayContainer<int>& p = test;
- auto i = p;
- auto&i = p; //!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement