In this project, we have to re-implement a few container types of the C++ standard template library.
Compile tests with my containers:
make
Compile test with real containers:
make real
Print the difference between the output of ./containers and ./containers_real:
make diff
Compile the subject main with my containers:
make subject
Compile the subject main with real containers:
make subject_real
Print the difference between the output of ./subject and ./subject_real:
make subdiff
Print the time of execution of ./subject and ./subject_real:
make time
A container is a holder object that stores a collection of other objects (its elements). They are implemented as class templates, which allows great flexibility in the types supported as elements. The container manages the storage space for its elements and provides member functions to access them, either directly or through iterators (reference objects with similar properties to pointers).
The containers we need to re-implement are:
- vector: Dynamic contiguous array
- stack: Adapts a container to provide stack (LIFO data structure)
- map: Collection of key-value pairs, sorted by keys, keys are unique
We also have to implement:
- std::iterator_traits
- std::reverse_iterator
- std::enable_if (c++11 feature)
- std::is_integral
- std::equal and/or std::lexicographical_compare (I do both)
- std::pair
- std::make_pair
- Only c++98 is allowed.
- The namespace must be ft.
- Each inner data structure used in your containers must be logical and justified (this means using a simple array for map is not ok).
- You cannot implement more public functions than the ones offered in the standard containers. Everything else must be private or protected. Each public function or variable must be justified.
- All the member functions, non-member functions and overloads of the standard containers are expected.
- You must follow the original naming. Take care of details.
- If the container has an iterator system, you must implement it.
- You must use std::allocator.
- For non-member overloads, the keyword friend is allowed. Each use of friend must be justified and will be checked during evaluation.
I used tests of others student in complement of mine: