ft_containers: Reimplementing the STL
December 10, 2022
École 42
Related Posts
Hi! ft_containers is the boss fight of the C++ branch: reimplement std::vector, std::map, std::stack (and std::set for the bonus) in C++98, so faithfully that switching ft:: for std:: in a test suite changes nothing.
insert,enable_if/is_integral tricks (SFINAE in C++98!) so the right overloads win,lexicographical_compare, const iterators, and all the operators nobody thinks about until they break.You stop being afraid of the standard library. After implementing a red-black tree and debugging its edge cases at 2 AM, std::map stops being a black box — you know what every operation costs and why. That intuition about data structures is probably the single most transferable thing I took from 42 into professional work.
Source code: github.com/Fatihcill/ft_containers
