ft_containers is a project written in C++ which require you to reimplement a few containers from the STL.
They must have all public member functions from C++98.
The corresponding iterators must also be implemented.
Unordered container with constant time for inserting/deleting elements.
Implemented as a linked-list.
Unordered container with fast access time with operator[]
.
Implemented as an array, similar to standard C arrays.
Stores pairs key = value
and is sorted by key
(custom function for sorting can be templated).
Implemented as a Binary Search Tree (BST)
Last In First Out (LIFO). Basic functionnality such as push_back
/ pop_back
/ accessing last element
.
Can be templated with any container supporting push_back
pop_back
back
empty
size
.
First In First Out (FIFO). Basic functionnality such as push_back
/ pop_front
/ accessing first/last element
.
Can be templated with any container supporting push_back
pop_front
back
front
empty
size
.
# include "includes/list.hpp"
# include "includes/vector.hpp"
# include "includes/map.hpp"
# include "includes/stack.hpp"
# include "includes/queue.hpp"
// Containers are in the 'ft' namespace
ft::list<int> list;
ft::vector<int> vector;
ft::map<int, std::string> map;
ft:stack<int> stack;
ft::queue<int> queue;
# Compile the sources
make
# Run the tests
./ft_containers_test [container_name] ..