C++ EXtended Template Library
ext is a small, header-oriented C++ utility library for projects that need portable building blocks across old and modern toolchains. It focuses on independent helpers around compatibility, strings, parsing, process I/O, threading, and small application patterns rather than trying to be a framework.
The library intentionally carries compatibility code for older compilers such as Visual Studio 2008 SP1 while also exposing cleaner APIs on newer C++ standards. Some features therefore have different availability and guarantees depending on compiler, standard library, and platform support.
- GCC 8.3.0+
- Clang 10.0+
- Visual Studio 2008 SP1+
- Boost 1.69.0+ (optional)
- Git 2.0+
- CMake 3.14+
See Build and Test for tested platforms, MSYS2 setup, and local test commands.
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(MyProject)
add_executable(tests tests.cpp)
include(cmake/CPM.cmake)
CPMAddPackage("gh:ntoskrnl7/ext@0.5.17")
target_link_libraries(tests ext)ext is best used as a collection of opt-in headers:
- Use one feature at a time; most headers are independent utility components.
- Prefer the standard library first when it already provides the exact behavior you need on every supported toolchain.
- Treat concurrency, cancellation, process, and shared-memory APIs as thin wrappers over platform behavior. Their exact guarantees are documented per API and summarized in Portability and API contracts.
- Compatibility shims live behind feature checks and
CXX_USE_*macros. New code should avoid depending on those internal macros unless it is extending ext itself.
| Feature | Header | Description |
|---|---|---|
| any_function | <ext/any_function> |
Type-erased function wrapper that accepts arguments as std::any values and reports argument count/type errors explicitly. |
| async_result | <ext/async_result> |
Asynchronous producer/result container with iterator-style consumption and cooperative cancellation flag support. |
| base64 | <ext/base64> |
Base64 encoder/decoder for strings, wide strings, byte vectors, and trivially copyable objects. |
| callback | <ext/callback> |
Multicast callback list with add/remove operators and argument forwarding. |
| c_object | <ext/c_object.h> |
C-compatible scoped object lifetime helpers with initializer/finalizer macros and custom allocation hooks. |
| cancelable_thread | <ext/cancelable_thread> |
Thread wrapper with deferred and immediate cancellation paths over pthread or Windows primitives. |
| cdbg | <ext/cdbg> |
Debug stream objects that write through platform debug sinks or console fallback streams. |
| chain | <ext/chain> |
Composable chain-of-responsibility helper with typed results, continuation links, and exception-aware result state. |
| debug_utils | <ext/debug_utils.h> |
Debugger detection and wait helpers for POSIX-style debug workflows. |
| collection | <ext/collection> |
Self-registering object collection with shared or exclusive locking around global per-type item lists. |
| ini | <ext/ini> |
INI parser and writer backed by nested string maps. |
| lang | <ext/lang> |
Korean language helpers for Hangul syllables, postpositions, and native/Sino-Korean number words. |
| named_mutex | <ext/named_mutex> |
Cross-process named mutex wrapper for coordinating shared resources and shared-memory payloads. |
| observable | <ext/observable> |
Observer pattern base template with automatic unsubscribe on observer or observable destruction. |
| path | <ext/path> |
Path helpers for existence checks, relative path detection, and path joining. |
| pipe | <ext/pipe> |
Cross-platform anonymous pipe wrapper for narrow and wide byte streams. |
| process | <ext/process> |
Cross-platform child process launcher with stdin/stdout/stderr pipe streams and process lifetime management. |
| property | <ext/property> |
Observable value wrapper with assignment validation and property-to-property propagation. |
| pstream | <ext/pstream> |
Native-handle-backed stream wrappers used to read from and write to process pipes. |
| result | <ext/result> |
Small ok/err result type for explicit value-or-error returns. |
| safe_object | <ext/safe_object> |
RAII lock proxy for globally named objects and mutexes selected at compile time. |
| shared_recursive_mutex | <ext/shared_recursive_mutex> |
Shared mutex variant that permits recursive locking by the owning thread. |
| shared_mem | <ext/shared_mem> |
Named shared memory creation, opening, mapping, unmapping, and destruction helpers. |
| singleton | <ext/singleton> |
CRTP singleton base that exposes one static instance per derived type. |
| string | <ext/string> |
String utility namespace for trimming, printable filtering, searching, splitting, replacement, numeric conversion, and UTF-8 helpers. |
| stl_compat | <ext/stl_compat> |
Compatibility macros, aliases, and fallback implementations for older C++ standards and compilers. |
| thread_pool | <ext/thread_pool> |
Fixed-size worker pool with future-returning task submission and explicit start/stop state. |
| type_traits | <ext/type_traits> |
Type-trait helpers for removing class qualifiers from member functions and deducing member-function signatures. |
| typeinfo | <ext/typeinfo> |
Portable type-name helper around C++ RTTI type information. |
| units | <ext/units> |
Strongly typed SI and IEC byte-size units with arithmetic and conversion helpers. |
| uri | <ext/uri> |
RFC 3986-oriented URI parser and percent-encoding helpers for narrow, wide, and UTF-8 input. |
| version | <ext/version> |
Semantic version parser, formatter, hashing, comparison, and mutation helper. |
| wordexp | <ext/wordexp> |
Environment or shell-style string expansion wrapper with platform-specific behavior. |
This project is distributed under the BSD-3-Clause license.