libdsc is a free and open-source C library featuring generic implementations of various containers provided by the C++ Standard Library.
libdsc currently reimplements the following containers:
-
std::vector
-
std::forward_list
-
std::list
-
std::unordered_map
-
std::unordered_set
-
std::stack
-
std::queue
All of these (re)implementations are generic (can store any data type), memory-safe, and benchmarked against their counterparts in the C++ Standard Library.
See ROADMAP.md for a list of containers we plan to (re)implement in the future.
First, build the project:
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_EXAMPLES=OFF
make
Then, to install the library system-wide:
sudo make install
This will install:
-
Library files to
/usr/local/lib
-
Header files to
/usr/local/include/libdsc
-
CMake configuration files to
/usr/local/lib/cmake/libdsc
On Debian-based Linux distributions (e.g., Debian, Ubuntu, Linux Mint):
sudo dpkg -i libdsc-*.deb
On RPM-based Linux distributions (e.g., Fedora, Red Hat):
Simply include the relevant headers in your project, like so:
#include <libdsc/vector.h>
#include <libdsc/list.h>
Complete examples can be found in the examples/
directory.
Google Test is used for unit testing. To run the tests, after building the project:
cd build
ctest --output-on-failure
Google Benchmark is used to measure the performance of libdsc's containers against their equivalents in the C++ Standard Library. Benchmarks are run weekly automatically via GitHub Actions. You can also run the benchmarks locally:
Benchmarks are automatica
mkdir -p build
cd build
cmake .. -DBUILD_BENCHMARKS=ON
make
cd benchmarks
./benchmark_*
Please read CONTRIBUTING.md carefully before you attempt to make any contributions to this project.
This project is licensed under the GPLv3. See LICENSE for details.