Sun 31 August 2025

🌊 Sane C++ August 25

SC

Welcome to the update post for August 2025!
This month we finally have Single File Libs!!!

Single File Libraries

One of the core principles of this project is to be "Easy to Integrate".
I'm always looking for ways to lower the barrier to entry for using these libraries in your own projects.

To that end, I'm happy to announce that all Sane Cpp Libraries are now available as single-file libraries!

This means you can now get the power of a library like SC::Async or SC::Process by simply dropping a single .h file into your project.
No complex build system integration, no scripts to runβ€”just include the header and build the source file. It's that simple.

There are two amalgamator tools written in Python and Javascript, that you can use to generate the single file libs locally on a checked out copy of the repo. Alternatively you can use the browser-based JavaScript amalgamator available at single_file_libs.html.

Detailed list of commits:

Threading

The Threading library received some love this month and has now been promoted to Usable status!

Here are some of the key additions:

I also fixed a tricky "lost wake-up" bug in EventObject's condition variable signaling, which improves the robustness of thread synchronization.

Detailed list of commits:

Async

The Async library received several important fixes, particularly for the io_uring backend on Linux and the IOCP backend on Windows.
These changes improve the reliability and prevent potential hangs or asserts when dealing with asynchronous file and pipe operations.

Detailed list of commits:

AsyncStreams

AsyncStreams has been promoted to MVP (Minimum Viable Product), meaning its core feature set is in place for concurrently reading, writing, and transforming byte streams.

Detailed list of commits:

Algorithms

The Algorithms library has been removed, or to be more precise it has been merged to Containers. The reason is pretty simple, I am not a great fan of using std-like algorithms aside from very simple usages. I find that any non-trivial usage of std C++ <algorithm> make code more difficult to read and reason about.
For this reason Sane C++ Algorithms library was only bringing 3 functions (removeIf, sort and find) so it made really little sense.
If you need std-like algorithms, just include <algorithm> or add some other library providing them to your project.

Detailed list of commits:

Process

Process library has been improved with arguments quoting on Windows. There's now better support for redirecting standard I/O and better support for ipc pipes in general, that has also involved the File library.

Detailed list of commits:

Strings

The Path and StringBuilder classes now have better support for to handle UTF8 and UTF16 encodings.
Throughout the libraries the philosophy is to keep strings in whatever encoding they've been given. Strings are lazy converted only when required by some OS API and in some cases this could lead to hitting asserts due to unsupported encodings.

Detailed list of commits:

Build

The self-hosted C++ build system can now generate workspace files that group multiple projects. This has been done to support testing compilation of the Single File Libs in the CI, but it can be useful in general.

If absolute paths are used when adding files to a project, they will be automatically made relative to the project root directory.

Some better checking in makefile generation has been added, to avoid trying to build non-existing configurations.

Detailed list of commits:

File

The file library gains methods to open stdin / stderr and stdout cross-platform.
Also the API for Pipe has been changed to make sure properly setting inheritable and blocking flags during creation, as in some platforms (Windows) some of these behaviors cannot be changed later (mainly setting OVERLAPPED_IO flags).

Detailed list of commits:

Other Improvements

Beyond these major updates, August included a bunch of other fixes:

Detailed list of commits: