Study how STL containers like vectors, hash maps, and red-black trees are built internally by reading the source
Run the included test suite to verify your understanding of standard library container behavior
Use as a reference when learning data structures and algorithms at a low level in C++
Compare your own STL implementations against this codebase to spot differences and bugs
Documentation and comments are written in Chinese, non-Chinese readers may need translation tools.
This repository is a re-implementation of a large portion of the C++ Standard Template Library, written using C++11 features. The Standard Template Library (STL) is the built-in collection of data structures and algorithms that comes with C++, providing things like dynamic arrays, linked lists, hash maps, and sorting routines. Building your own version from scratch is a common way to learn how those pieces work internally. The project was started as a first learning exercise by the author and has grown to version 2.x.x, which covers the vast majority of STL containers and functions. The documentation and source code comments are written in Chinese. From version 2.0.0 onward, the project entered a maintenance-only phase, meaning new features will not be added but bug fixes will continue. The README notes that there may still be deficiencies and bugs, and invites issues and pull requests. The code builds on Linux, Windows, and macOS using g++, clang++, or MSVC. CMake is listed as optional for building. A test suite is included and instructions for running it are in the Test subdirectory. For Windows, a Visual Studio solution file is provided as an alternative to CMake. This is a reference and study project rather than a library intended for production use. Anyone curious about how containers like vectors, queues, or red-black trees are built at a low level can read through the source. Additional documentation is available in the repository's Wiki.
← alinshans on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.