Fill standard library gaps with C++ utilities tested daily at Google
You can add features missing from the C++ standard library or alternatives for specific situations directly to your code. This collection of code is widely tested and used daily within Google, making it a stable tool for complex systems. It is not a replacement for the standard library but a supplementary tool that complements areas the standard does not cover.
Practical tools from internal Google code
Abseil is an open-source collection gathered from Google's C++ codebase. It conforms to the C++17 standard and aims to extend the standard library. It fills in missing pieces or provides alternatives for special requirements discovered during Google's usage. It is shared as a resource for the entire community rather than a competitor to the standard library. All code is extensively tested and used daily in Google's routine development environment.
Key functional components
The library is divided into several subcomponents, allowing you to use only the parts you need.
- Containers and algorithms It provides additional STL-style containers and extensions to the
algorithmlibrary. This includes unordered containers based on 'Swiss table'. - Synchronization and memory management It includes concurrency primitives such as
absl::Mutexand memory management facilities that complement the C++<memory>library. - Error handling and logging It offers error handling abstractions through
absl::Statusandabsl::StatusOr<T>, along with logging features usingLOGandCHECKmacros. - String and time handling It supports various string utilities and time calculation abstractions, including timezone formatting and parsing.
Build system and support scope
The official build systems are Bazel and CMake. For a quick start, refer to the Quickstart documentation, which guides you from setting up the development environment to running tests. Supported versions of compilers, platforms, and build tools follow Google's Foundational C++ Support Policy. While the 'live-at-head' approach of frequently updating to the latest commit is recommended, long-term support (LTS) releases that backport critical bug fixes are also provided.
Pre-adoption considerations
Abseil is distributed under the Apache license and complies with the C++17 standard. Since it is not intended to completely replace the standard library, you should consider its interaction with the standard when adding it to existing projects. Some components (e.g., profiling) may only be used as internal dependencies of other Abseil libraries, so you must verify the scope of independent usage. Because it follows Google's support policy, you must always check whether your compiler and platform are included in the support list.