absl::Hash
By Greg Falcon, Abseil Engineer
Abseil now provides an options
file,
providing a limited means of configuring Abseil’s features. In the initial
release of this options mechanism, we have added the ability to override
Abseil’s automatic type detection and force (for example) absl::string_view
to
either always alias to std::string_view
, or always remain using our Abseil
implementation.
The key word above is “limited”: these options are dangerous if used incorrectly, and can only be safely used in some contexts. This blog post explains this feature and how to correctly use it.
While we discourage relying on compiled representations of libraries, we recognize this isn’t always possible for providers of binaries or compiled libraries (such as package managers). This options mechanism is provided to allow those providers to ensure that copies of Abseil use the same implementation. For information on how to use this options mechanism to provide such ABI stability, consult our Options guide.
Two copies of Abseil configured with different options are incompatible, in exactly the same way that two different source snapshots of Abseil are incompatible. Abseil options must be set consistently across an entire program. They cannot be changed on a per-library basis.
These options are dangerous if used incorrectly, and can only be safely used in some contexts.
Because of the increased testing burden they impose, we plan to keep the set of options we support small. If you change any options, we recommend that you run the Abseil unit tests, to ensure your settings work with your toolchain. The default options we ship with reflect how we use Abseil internally. This is the configuration that is “battle tested” in Google’s C++ codebase.