ft_containers is 42 project that involves the implementation of C++98 STL containers from scratch.
This project aims to understand and reproduce templated classes that behave like C++98 STL containers. This includes all methods from the following containers:
vector, map, set and stack and practical features.
Clone the repository:
# Clone this repository
git clone https://github.com/bbordere/ft_containers42.git
# Go into the repository
cd ft_containers42You simply have to run:
makeThis produces two executables that test the different containers. One uses the STL containers and the other uses our custom containers.
To run the program:
./ft_containers <container to test> # Custom containers version
# Or
./std_containers <container to test> # STL containers versionIf no argument is provided, this tests all containers
vector: Sequence container representing dynamic arraymap: Associative container that stores the key / value combinationstack: Container adaptor designed to operate as LIFO structure (Last In First Out)set: Container that stores unique elements following a specific order
iterators_traits: Type trait class that provides interfaces for LegacyIteratorreverse_iterator: Iterator adaptor that reverses the direction of a given iteratorenable_if: Use the SFINAE rule to a typeis_integral: Check if given type is an integral typeequal: Check if two ranges of iterator are equallexicographical_compare: Check if the first range is lexicographically less than the secondpair: Class template that provides a way to store two heterogeneous objects as a single unitmake_pair: Creates apairobject, deducing the target type from the types of arguments