A learning C++ project implementing selected STL-like containers and utilities, with test harnesses and comparison outputs against the STL.
ft_containers implements core STL-like containers and utilities (vector, map, stack, iterators, type traits, algorithms, etc.) for learning purposes and to validate behavior against the standard library. It contains the implementation, samples/tests, and scripts to build and compare outputs between the custom containers and the STL.
- Custom STL-like containers:
- vector, map, stack
- iterator support
- type_traits utilities
- utility helpers
- some standard algorithms
- Test harness (
main.cpp) to exercise containers and compare outputs. - Shell script (
tester.sh) to automate building and running tests. - Logs comparing STL vs custom implementations (
stlOutput.log,ftOutput.log).
- Language: C++98
- Build: Make (
Makefile) - Shell scripting:
tester.sh - Compiler: g++ / clang++ (POSIX environment)
algorithm/— algorithm implementationsiterator/— iterator classes / utilitiesmap/— map containerstack/— stack containervector/— vector containertype_traits/— type traits utilitiesutility/— helpers (pair, swap, etc.)samples/— usage examplestests/— test casesmain.cpp— test runner / example usageMakefile— build rulestester.sh— runs build/tests automaticallystlOutput.log,ftOutput.log— comparison logs
- POSIX-compatible system (Linux, macOS, WSL)
- C++ compiler (C++98 compliant)
- make, bash/sh
git clone https://github.com/procrastinator-101/ft_containers.git
cd ft_containers
makeRun tests:
./tester.shOr run compiled test binary:
./ft_containersCompare STL vs custom containers:
make
./tester.sh
less stlOutput.log
less ftOutput.logQuick manual test:
./ft_containersInclude headers from vector/, map/, etc. in your code to exercise individual containers.
Makefile — build/clean targets
tester.sh — automates compilation and logs outputs
Common targets:
make # build
make clean # remove object files
make fclean # remove binaries
make re # fclean + buildContainer code is implemented in named directories (vector, map, stack, iterator, type_traits, utility, algorithm).
main.cpp runs tests comparing custom containers vs STL equivalents.
tester.sh builds both versions, runs tests, and logs output to stlOutput.log and ftOutput.log.
Comparing the logs highlights behavioral differences for validation.