Question: template class DList { friend class UnitTests _ Lab 3 ; / / Giving access to test code struct Node { / / NOTE: Values

template
class DList {
friend class UnitTests_Lab3; // Giving access to test code
struct Node {
// NOTE: Values set to -1 for unit test purposes
Type data;
Node* next = reinterpret_cast(-1);
Node* prev = reinterpret_cast(-1);
Node(const Type& _data, Node*_next = nullptr, Node*_prev = nullptr){
// TODO: Implement this method
}
};
public:
class Iterator {
public:
Node* mCurr = reinterpret_cast(-1);
Iterator& operator++(){
// TODO: Implement this method
}
Iterator operator++(int){
// TODO: Implement this method
}
Iterator& operator--(){
// TODO: Implement this method
}
Iterator operator--(int){
// TODO: Implement this method
}
Type& operator*(){
// TODO: Implement this method
}
bool operator !=(const Iterator& _iter) const {
return mCurr !=_iter.mCurr;
}
};
// Data members
// NOTE: All values set to -1 for unit test purposes
Node* mHead = reinterpret_cast(-1);
Node* mTail = reinterpret_cast(-1);
size_t mSize =-1;
public:
DList(){
// TODO: Implement this method
}
~DList(){
// TODO: Implement this method
}
DList(const DList& _copy){
// TODO: Implement this method
}
DList& operator=(const DList& _assign){
// TODO: Implement this method
}
void AddHead(const Type& _data){
// TODO: Implement this method
}
void AddTail(const Type& _data){
// TODO: Implement this method
}
void Clear(){
// TODO: Implement this method
}
Iterator Insert(Iterator& _iter, const Type& _data){
// Implement this method
}
Iterator Erase(Iterator& _iter){
// TODO: Implement this method
}
Iterator Begin() const {
// TODO: Implement this method
}
Iterator End() const {
// TODO: Implement this method
}
};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!