![]() |
Zen C++ Libraries
Zero-dependency re-usable components for C++
|

The Zen C++ libraries are a set of C++ headers and sources that augment the C++ standard library. The libraries try to fill missing pieces in the existing C++ ecosystem, based on ideas taken from Haskell and Rust.
⚠️🧪 These libraries are experimental. They require a modern C++ compiler that supports at least C++20. The API may break regularly with the release of new versions. If you plan to make use of them right now, expect to refactor your code regularly.
Use this library only if you feel like these drawbacks are justified for the project you're working on.
We support Meson and CMake. Currently, the preferred method for using these libraries is by downloading a recent tarball of the repository's source and checking in the sources into your project's version control system.
If you're building a library that uses Zen++ internally, it is highly recommended to define a custom Zen++ namespace. Doing so will avoid conflicts with dependencies that use a different version of these libraries. For instance, if your project has a namespace mylib, you would define the Zen namespace as mylib::zen.
Meson is the recommended choice for setting up your project. Download a tarball of this repository and drop the contents in subprojects/zen. Next, adjust the following example to match your project setup.
meson.build
CMake is also supported, although we really recommend using Meson. CMake does not play nice with in-source subprojects because there's no elegant way to emulate Meson's default_options. Until we have figured out how to do it properly, you might want to use the following.
CMakeLists.txt
Documentation will soon be available on the official website. For now, you will have to consult the header files in zen/ to learn more. Alternatively, you can try to build the documentation locally using Doxygen.
This library is licensed under Apache 2.0 license. Briefly put, you are allowed to use this library commercially as long as you give due credit to the authors that put their time and energy in building this.
See the LICENSE file for more information.