abseil / abseil-cpp

abseil / abseil-cpp

Abseil - C++ Common Libraries The repository contains the Abseil C++ library code. Abseil is an open-source collection of C++ code (compliant to C++17) designed to augment the C++ standard library. Abseil - C++ 通用库 本仓库包含了 Abseil C++ 库的代码。Abseil 是一个开源的 C++ 代码集合(兼容 C++17 标准),旨在增强 C++ 标准库的功能。


About Abseil

Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google’s own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives. In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we’ve found through usage in the Google code base. We denote those cases clearly within the library code we provide you. Abseil is not meant to be a competitor to the standard library; we’ve just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole.

关于 Abseil

Abseil 是一个开源的 C++ 库代码集合,旨在增强 C++ 标准库。Abseil 的库代码源自 Google 内部的 C++ 代码库,经过了广泛的测试并在生产环境中得到应用,正是我们在日常编码中所依赖的代码。在某些情况下,Abseil 提供了 C++ 标准库中缺失的部分;在另一些情况下,针对我们在 Google 代码库使用过程中发现的特殊需求,Abseil 提供了标准库之外的替代方案。我们在提供给您的库代码中明确标注了这些情况。Abseil 并非旨在与标准库竞争;我们只是发现这些实用工具在我们的代码库中非常有用,因此现在希望将这些资源提供给整个 C++ 社区。


Quickstart

If you want to just get started, make sure you at least run through the Abseil Quickstart. The Quickstart contains information about setting up your development environment, downloading the Abseil code, running tests, and getting a simple binary working.

快速入门

如果您想立即开始,请务必至少阅读一遍 Abseil 快速入门指南。快速入门包含有关设置开发环境、下载 Abseil 代码、运行测试以及构建简单二进制文件的相关信息。


Building Abseil

Bazel and CMake are the official build systems for Abseil. See the quickstart for more information on building Abseil using the Bazel build system. If you require CMake support, please check the CMake build instructions and CMake Quickstart.

构建 Abseil

Bazel 和 CMake 是 Abseil 的官方构建系统。有关使用 Bazel 构建系统构建 Abseil 的更多信息,请参阅快速入门指南。如果您需要 CMake 支持,请查看 CMake 构建说明和 CMake 快速入门。


Support

Abseil follows Google’s Foundational C++ Support Policy. See this table for a list of currently supported versions compilers, platforms, and build tools.

支持

Abseil 遵循 Google 的基础 C++ 支持策略。请参阅此表格以获取当前支持的编译器、平台和构建工具版本列表。


Codemap

Abseil contains the following C++ library components:

代码映射

Abseil 包含以下 C++ 库组件:

  • base: The base library contains initialization code and other code which all other Abseil code depends on. Code within base may not depend on any other code (other than the C++ standard library). base: 基础库,包含初始化代码以及所有其他 Abseil 代码所依赖的代码。base 内部的代码不得依赖任何其他代码(C++ 标准库除外)。
  • algorithm: The algorithm library contains additions to the C++ <algorithm> library and container-based versions of such algorithms. algorithm: 算法库,包含对 C++ <algorithm> 库的补充,以及基于容器的算法版本。
  • cleanup: The cleanup library contains the control-flow-construct-like type absl::Cleanup which is used for executing a callback on scope exit. cleanup: 清理库,包含类似控制流结构的类型 absl::Cleanup,用于在作用域退出时执行回调。
  • container: The container library contains additional STL-style containers, including Abseil’s unordered “Swiss table” containers. container: 容器库,包含额外的 STL 风格容器,包括 Abseil 的无序“瑞士表”(Swiss table)容器。
  • crc: The crc library contains code for computing error-detecting cyclic redundancy checks on data. crc: CRC 库,包含用于计算数据检错循环冗余校验的代码。
  • debugging: The debugging library contains code useful for enabling leak checks, and stacktrace and symbolization utilities. debugging: 调试库,包含用于启用内存泄漏检查、堆栈跟踪和符号化工具的代码。
  • flags: The flags library contains code for handling command line flags for libraries and binaries built with Abseil. flags: 标志库,包含用于处理使用 Abseil 构建的库和二进制文件的命令行标志的代码。
  • hash: The hash library contains the hashing framework and default hash functor implementations for hashable types in Abseil. hash: 哈希库,包含哈希框架以及 Abseil 中可哈希类型的默认哈希仿函数实现。
  • log: The log library contains LOG and CHECK macros and facilities for writing logged messages out to disk, stderr, or user-extensible destinations. log: 日志库,包含 LOG 和 CHECK 宏,以及用于将日志消息写入磁盘、stderr 或用户可扩展目标的工具。
  • memory: The memory library contains memory management facilities that augment C++‘s <memory> library. memory: 内存库,包含增强 C++ <memory> 库的内存管理工具。
  • meta: The meta library contains type checks similar to those available in the C++ <type_traits> library. meta: 元编程库,包含类似于 C++ <type_traits> 库中的类型检查功能。
  • numeric: The numeric library contains 128-bit integer types as well as implementations of C++20’s bitwise math functions. numeric: 数值库,包含 128 位整数类型以及 C++20 位运算数学函数的实现。
  • profiling: The profiling library contains utility code for profiling C++ entities. It is currently a private dependency of other Abseil libraries. profiling: 性能分析库,包含用于分析 C++ 实体的实用代码。目前是其他 Abseil 库的私有依赖项。
  • random: The random library contains functions for generating pseudorandom values. random: 随机数库,包含用于生成伪随机值的函数。
  • status: The status library contains abstractions for error handling, specifically absl::Status and absl::StatusOr<T>. status: 状态库,包含错误处理的抽象,特别是 absl::Statusabsl::StatusOr<T>
  • strings: The strings library contains a variety of strings routines and utilities. strings: 字符串库,包含各种字符串处理例程和实用工具。
  • synchronization: The synchronization library contains concurrency primitives (Abseil’s absl::Mutex class, an alternative to std::mutex) and a variety of synchronization abstractions. synchronization: 同步库,包含并发原语(Abseil 的 absl::Mutex 类,std::mutex 的替代品)以及各种同步抽象。
  • time: The time library contains abstractions for computing with absolute points in time, durations of time, and formatting and parsing time within time zones. time: 时间库,包含用于计算绝对时间点、时间段,以及在时区内格式化和解析时间的抽象。
  • types: The types library contains non-container utility types. types: 类型库,包含非容器类的实用类型。
  • utility: The utility library contains utility and helper code. utility: 实用工具库,包含各种实用程序和辅助代码。

Releases

Abseil recommends users “live-at-head” (update to the latest commit from the master branch as often as possible). However, we realize this philosophy doesn’t work for every project, so we also provide Long Term Support Releases to which we backport fixes for severe bugs. See our release management document for more details.

发布

Abseil 建议用户“紧跟主干”(尽可能频繁地更新到 master 分支的最新提交)。然而,我们意识到这种理念并不适用于所有项目,因此我们也提供长期支持版本(LTS),我们会将严重错误的修复程序向后移植到这些版本中。有关更多详细信息,请参阅我们的发布管理文档。


License

The Abseil C++ library is licensed under the terms of the Apache license. See LICENSE for more information.

许可证

Abseil C++ 库采用 Apache 许可证授权。有关更多信息,请参阅 LICENSE 文件。


For more information about Abseil:

  • Consult our Abseil Introduction
  • Read Why Adopt Abseil to understand our design philosophy.
  • Peruse our Abseil Compatibility Guarantees to understand both what we promise to you, and what we expect of you in return.

链接

有关 Abseil 的更多信息:

  • 查阅我们的 Abseil 简介
  • 阅读“为什么要采用 Abseil”以了解我们的设计理念。
  • 细读我们的 Abseil 兼容性保证,以了解我们对您的承诺,以及我们对您的期望。