Implementation of a few c++ container using c++98
see the en.subject.pdf
Mandatory part : 100/100
Bonus : 25/25
This repository contains a C++ implementation of several commonly used STL containers, including vector, stack, map, and set. The implementation is written in C++98 and is intended to be compatible with older compilers.
Each container is implemented as a separate class, with a similar interface to the corresponding STL container including the iteartor to each container that need an iterator ...
The containers are implemented using templates, so they can store any type of object. However, there are some limitations on the types that can be stored, such as restrictions on copy constructors and assignment operators.
This implementation is intended to be a learning resource for those who want to understand how the STL containers work under the hood, as well as a reference for those who need to use a subset of the containers in an older codebase.
The set and map containers are implemented using a Red-Black Tree. the Red-Black Tree implementation is included in the red-black_tree.hpp
header file,
and is used by the set and map containers to maintain their order and perform fast lookups. The tree is balanced and self-adjusting,
ensuring efficient operations even for large datasets.
The implementation has been tested using the ft_containers-unit-test, which can be found at https://github.com/divinepet/ft_containers-unit-test. The tests cover a wide range of scenarios and edge cases, and are designed to ensure that the containers behave correctly and efficiently.
In addition to the unit tests, I have included some additional tests in the tests
directory. These tests cover some additional scenarios and edge cases, and can be run using make and the appropriate command line arguments. The available tests are:
main -v: Runs tests for the vector container.
main -st: Runs tests for the stack container.
main -s: Runs tests for the set container.
main -m: Runs tests for the map container.
Optional [-fast] argument can be added to run a fast version of the tests.