A C++ template library implementing doubly-linked list (MyList), dynamic array (MyVector), and queue (MyQueue) with MyList or MyVector backends. Features iterators, copy/move semantics, initializer lists, and interoperability between containers.
Includes unit tests in main.cpp and CMake build support.
- MyList: Doubly-linked list with sentinel node, bidirectional iterators (mutable/const),
push_back/front,pop_back/front,insert,find/rfind,clear. - MyVector: Dynamic array with capacity growth, random access,
resize/reserve/grow,push_back/pop_back. - MyQueue: Adapter with
push/pop/first/last/size/isempty; supportsMyList(O(1) operations) orMyVector(circular buffer) backends. - STL-like operators:
<<for output, copy/move assignment/constructors. - Edge cases: Empty containers, move semantics, interoperability (e.g.,
List -> Queue -> Vector).
Requires C++23.
mkdir build && cd build
cmake ..
make
./mainRuns all tests printing container states and operations.
MyList<int> list;
list.push_back(10); list.push_front(5);
std::cout << list.first() << " " << list.last() << std::endl; // 5 10
auto it = list.find(5);
list.insert(999, it);MyVector<int> vec{1,2,3};
vec.push_back(4); vec.resize(5);MyQueue<int, MyList<int>> q;
q.push(10); q.push(20);
std::cout << q.first() << " " << q.last() << std::endl; // 10 20
q.pop(); // Removes 10Full tests in src/main.cpp demonstrate all functionality.
├── include/
│ ├── mylist.h/inl
│ ├── myvector.h/inl
│ └── myqueue.h/inl
├── src/main.cpp
└── CMakeLists.txt