Abstract
ALib is a general purpose, use-case agnostic, platform-independent, low-level C++ class library.
Its mission is to provide foundational concepts, types, and idioms relevant to any C++ project. As of today, ALib consists of 25 modules, each addressing different topics.
A subset of the available modules can be selectively included in a custom library build. This means you just get what you choose from the menu.
New In this Version
Dropped support of language version C++17. With that:
- All use of
std::enable_if
(and similar) have been replaced by C++20 Concepts.
- Support for C++20 Modules was added. (This is in alpha state and works only on newest Clang compilers).
The latter was a little bit of a journey, and we have created a blog-page describing our experiences. Here it is: Observations Made When Shifting ALib to C++20 Modules.
For more news, consult the Change Log.
Some highlights of the functionality
- Module ALib Strings: String-types with interfaces similar to Java/C#, compatible with anything that "smells" like a string. (Technically, this is achieved by using some type traits magic.)
- Module ALib Boxing: Consider this as "std::any on steroids".
- Modules ALib EnumOps and ALib EnumRecords: Finally, we get what we expected from C++ enums.
- Module ALib Monomem: Monotonic allocation with recycling. Why use the oh-so-slow heap?
- Module ALox: Logging for adults.
- Module ALib BitBuffer: Write bit-streams instead of human-readable text.
- Module ALib CLI: Command line parser with support of environment variables and configuration files.
- Module ALib Expressions: Type-safe run-time expression compiler. Easily extensible to support your custom expression functions. 130+ (optional) predefined functions (math, string compare, date/time, etc.)
- Module ALib Variables: Run-time variables for C++. Its priority-management allows hard-coding defaults and having them be overridden by configuration files, environment-variables or command-line parameters.
- Module ALib Files: A directory and file scanner (with run-time expression support).
- Module ALib Format: Formatting of strings with Python-like and alternatively Java-like syntax.
- Module ALib ThreadModel: A dynamic thread-pool implementation, dedicated worker threads with prioritized job-management, and periodic event-triggering.
- And last but not least: Many more tools like managing bootstrapping of C++ software, externalized resources, configuration data, singletons with Windows DLLs, ...
Main Characteristics And Design Goals
- ALib is free software.
- Compiles with standards C++20 and 23.
- Modularization: Possible selective use of only parts of the library.
- Extensive documentation.
- Least intrusive: Designed to keep user code as independent of ALib types and idioms as possible.
- Ease of use by design.
When things become complex, features are hidden behind default behavior and are only available to users who read the detail chapters of the various Programmer's Manuals. 😅
- Developed and steadily tested under GNU/Linux, Windows OS, Mac OS, and Raspberry. For details in respect to the current release, see section below.
Documentation
The following documentation is provided.
- A General Library Manual is available describing the library structure, its setup and compilation, bootstrapping, etc.
- 25 separated Programmer's Manuals are published on this website! (One for each ALib Module).
The manuals are well-structured, provide step-by-step source-code tutorials and often go into in-depth discussions in respect to design decisions and overall rationals behind important features of the ALib Modules.
- Reference Documentation which is covering 100% of the provided types, members, functions, namespaces, macros, etc. In short, each and every C++ entity is documented.
- A detailed version history, documenting every interface change is found in the Change Log.
- All documentation provided leverages the full power of Doxygen
(the industry standard). Therefore, changes in the library's interfaces are always detected and corrected. The many code samples are implemented as unit tests and thus are "live"-integrated to the documentation, often together with the output text snippets of the recent unit test run. (See an example here.)
- Note
- Summary: ALib comes with a complete book of documentation, which has more than 1000 pages if printed. Its all explained, for beginners and experts!
IDE / Build System Setup
Check out chapter 6. Building The Library for details of how to compile and use ALib in your C++ environment.
The current release got tested on the following platform combinations:
- GNU/Linux Arch 6.16.8, Clang++ 20.1.8, C++20/23, 32-Bit / 64-Bit, optional C++20 Module Support
(This is the main development platform.)
- GNU/Linux Arch 6.16.8, GNU C++ 15.2.1, C++20/23, 32-Bit / 64-Bit
- WindowsOS 11, MSC 19.44 (Visual Studio 2026 Insiders, Platform v145), C++20, 32-Bit/64-Bit
- WindowsOS 11, MinGW, 64-Bit, GCC 13.47, C++20
- macOS Tahoe 26.0, Apple M2 / ARM64, Apple Clang Version 17.0.0, C++20/23, 64-Bit
- Raspberry 3, aarch64, Cortex-A53, GNU C++ 12.2.0, C++20/23
- Raspberry 4, aarch64, Cortex-A72, GNU C++ 12.2.0, C++20/23
- Raspberry 4, armhf (32-bit), Cortex-A72, GNU C++ 12.2.0, C++20/23
C# and Java Versions Of ALib
Parts of ALib have sibling incarnations in programming languages C# and JAVA. Historically, ALib aimed to be a cross platform/cross language library. This goal was (mostly) dropped in favor to be able to independently develop ALib for C++.
ALib for C# and ALib for Java are included in and distributed with the cross platform ALox Logging Library
.
For C++, since May 2018 release, the situation was inverted: Instead of having ALib bundled with ALox, the logging library is now an ALib Module.
License
ALib is free software, can be downloaded at Github
and sources are published under Boost Software License:
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Library Dependencies
ALib compiles as is, hence it is not dependent on any 3rd-party library. Optional dependencies exist. For example if boost
is available, ALib Strings are using its regex search.
In contrast, ALib provides optional compatibility headers for 3rd-party libraries (e.g., QT Class Library
), which for example provide adoptions of ALib type-traits for QT-types.
Contributions
We would be happy, if the community started to support this library and are willing to receive contributions and, if accepted, to update the code accordingly.
Note that for legal reasons, we hereby explicitly refuse and reject code (or ideas for code) that are not explicitly provided under the Boost Software License. Please do not even contact us with your ideas/code in that case.
Thanks
Our thanks go to all supporters that did and do help realizing this project. Furthermore to just all of these millions of supporters of free software, including:
Special thanks also to C. Darwin, who created life on earth hundreds of millions of years ago, until he - when things became too crazy - disappeared in 1882.