1234567891011121314151617181920212223242526 |
- #include "List.h"
- // âñòðîåííûé îáúåêò m_Data äîëæåí ñòàòü êîïèåé îáúåêòà, íà êîòîðûé óêàçûâàåò pc
- Node::Node(Node* Prev, const Circle* pc) :m_Data(*pc)
- {
- pPrev = Prev;
- pNext = Prev->pNext;
- Prev->pNext = this;
- pNext->pPrev = this;
- }
- Node::~Node()
- {
- if (pPrev) { pPrev->pNext = /*this->*/pNext; }
- if (pNext) { pNext->pPrev = /*this->*/pPrev; }
- pPrev = pNext = nullptr;
- //delete[] this;
- }
- std::ostream& operator<<(std::ostream& os, const Node& node)
- {
- os << node.m_Data;
- return os;
- }
|