A customizable, in-progress template container library that allows seamless swapping of underlying data structures for common container types. This project is designed to give developers control over performance and memory characteristics by selecting specific data structures at compile time.
- Template-Based Design: Enables specifying the underlying data structure for containers.
- Versatility: Supports multiple implementations of ordered and unordered containers.
- Ease of Use: Simple syntax for creating custom containers.
// Declare a map using a Red-Black Tree as the underlying data structure
Map<std::string, int, RedBlackTree>
// Declare a set using a Binary Tree
Set<int, BinaryTree>
// Declare a map with the default underlying structure
Map<int, int>
- Red-Black Tree
- Binary Search Tree (Note: Not fully compliant with template traits)
- Open-Address Hash Table
- Robinhood Hashing (Open Address)
- C++ Compiler: Ensure you have a compiler that supports C++17 or later.
- Visual Studio: Recommended for working with the provided
.sln
file. - CMake (optional): For building without Visual Studio.
- Clone the repository:
git clone <repository-url> cd Containers
- Open
Containers.sln
in Visual Studio.
- Open the
Containers.sln
solution file. - Select the build configuration (
Debug
orRelease
). - Build the solution by pressing
Ctrl+Shift+B
.
Unit tests are provided to validate the implementation of various data structures. To run the tests:
- Build the
UnitTests
project in Visual Studio. - Execute the resulting binary.
TestFlatTree.cpp
: Tests for theFlatTree
implementation.TestHashTables.cpp
: Tests for hash table implementations.TestSmallVec.cpp
: Tests for theSmallVec
utility.
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear description of your changes.
This project is open source. For details, please refer to the LICENSE
file.
For questions or suggestions, please open an issue in the repository.