These are equivalent since they fall back to the standard library. There's no need to reimpose whatever constraints the standard library already imposes.
PiperOrigin-RevId: 926341943
Change-Id: I406d1203ca2d4fec68ae7a06eef0cf2dad6916dd
The comment is updated to accurately reflect that `absl::variant` was the polyfill and is now an alias for `std::variant`.
PiperOrigin-RevId: 919336725
Change-Id: If39bd3f61f229f561d547391ca97015688b1fad1
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 906360966
Change-Id: Iee362ac0eac647909ef38003280f1179813f764d
This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.
This change also changes the assertion functions from inline to constexpr, to allow functions using them to be called from static assertions (like optional_ref::operator* in optional_ref's constexpr test).
PiperOrigin-RevId: 903344377
Change-Id: I50166b6cf12a8f139ed3c9fe4f6c6e0f24b51812
This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.
This change also changes the assertion functions from inline to constexpr, to allow functions using them to be called from static assertions (like optional_ref::operator* in optional_ref's constexpr test).
PiperOrigin-RevId: 903309187
Change-Id: Icbe0fd9d0fe9e212036d17468e80833b95b8a82d
Most usages of absl::void_t compile fine with std::void_t, so we migrate them here. A few don't compile due to overly eager template instantiations, so we leave those.
PiperOrigin-RevId: 897231619
Change-Id: Iad34101916dac2b995257ebd5d6aacb9a0acfa32
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 894202105
Change-Id: I57bb2a1647be1fedf9b724a07042fd0f564ce074
This is intentionally not exposing absl::SourceLocation to Rust yet, since the ownership questions (absl::Status vs. interning etc.) have not yet been decided.
PiperOrigin-RevId: 889297573
Change-Id: I14ed9c1b03c4229bc59e746b49685e87778e6b46
This library contains helper functions that allow throwing exceptions
consistently from anywhere, without risk of ODR violations. When
execptions are disabled, these functions abort the program.
The old internal spellings will be removed in a follow up change.
PiperOrigin-RevId: 867594519
Change-Id: Ibd7a447f5577247bced718617f5da662d983d185
`std::span::subspan()` has stricter preconditions than its `absl::`
counterpart. Supplying a `len` that would extend beyond the end of the
span is undefined behavior for `std::span` (unless `len` is the default
`npos` value), whereas `absl::span` simply truncates the result.
PiperOrigin-RevId: 836331418
Change-Id: I0e9a11cb434deca0b88d761e8233a44d5a9273ce
The conversions invoke the wrong constructor and merely happen to work correctly. However, they break trivial-copyability, and may also break if the constructor behaviors diverge (such as if a lifetime attribute is added).
PiperOrigin-RevId: 782932715
Change-Id: I280a03341887af241cf636c09f1c4318dc98fc16
absl_nullability_unknown to workaround a bug that makes nullability
checks trigger in foreach loops, while still fixing the
-Wnullability-completeness warnings.
PiperOrigin-RevId: 755951074
Change-Id: Ia6eea53f381d9255856a3f85efa41f0dfbd5c684
the Clang version used in the Linux ARM CI to Clang 19.
nullability-completeness is an all-or-nothing warning, and it is
enabled by default. If anything is annotated, everything has to be
annotated.
There are a few types of fixes in this change. The most common is just
to add missing annotations. In a few cases, some SFINAE methods are
changed not to use pointers at all. In some cases, like
cord_internal.h, I removed the single annotation as that is easier
than doing the entire complicated file for now. cordz_test_helpers.h
uses GoogleTest macros, which bring in pointers that can't easily be
annotated, so I removed the annotations from this file as well.
Tests are also opted-out of the warning.
I'm not sure why the x86 Clang version didn't pick these issues up.
PiperOrigin-RevId: 755844859
Change-Id: I7d7f4cc4f6d779f52c86a4d96e07880341244491
When a container or a string is mixed, size is only supplementary data.
We are still mixing size to avoid hash expansion to be a suffix of one another.
Mixing is done by addition `size + Seed()`. `+ Seed()` is needed to make an empty string to change the hash state. We assume that `Seed()` is already loaded to some register. Addition would modify low bits that will be spread with data mixing later.
We considered the following optimization. Mix the size at the beginning in order to improve the dependency graph. Mixing would happen in parallel with reading strings data. It's not feasible because absl::Hash API requires that hash expansions can't be suffixes of each other.
```
name old CYCLES/op new CYCLES/op delta
BM_latency_AbslHash_String3 27.2 ± 0% 21.5 ± 0% -21.08% (p=0.000 n=52+52)
BM_latency_AbslHash_String5 28.1 ± 8% 22.3 ±11% -20.70% (p=0.000 n=57+57)
BM_latency_AbslHash_String9 27.7 ± 9% 22.2 ±17% -19.77% (p=0.000 n=56+57)
BM_latency_AbslHash_String17 25.9 ± 5% 21.2 ±23% -18.02% (p=0.000 n=57+54)
BM_latency_AbslHash_String33 28.0 ± 5% 22.5 ± 4% -19.69% (p=0.000 n=54+54)
BM_latency_AbslHash_String65 37.9 ± 8% 32.2 ±10% -15.19% (p=0.000 n=52+53)
BM_latency_AbslHash_String257 57.1 ± 8% 52.0 ±10% -8.88% (p=0.000 n=52+54)
```
PiperOrigin-RevId: 750151406
Change-Id: I2245bad4906960d9236bea671738a218a85eb1af
prior to C++17. `absl::variant` is now an alias for `std::variant`.
It is recommended that clients simply use `std::variant`.
PiperOrigin-RevId: 730940936
Change-Id: I7157612a62eec036abf61dd1ad42c5945afeac1d
prior to C++17. `absl::optional` is now an alias for `std::optional`.
It is recommended that clients simply use `std::optional`.
PiperOrigin-RevId: 729860560
Change-Id: I8f3a23ed46c451cb441771cc544df79e6c326b67
to C++17. `absl::any` is now an alias for `std::any`. It is
recommended that clients simply use `std::any`.
PiperOrigin-RevId: 729541787
Change-Id: I4a677704bca31d4c602b73ac2dc12cac1fe18793
Now that Abseil only supports C++17 and beyond, these `base_internal` symbols [are just aliases](05e72a3285/absl/base/internal/invoke.h (L42)) in C++ >= 17. Replacing them in `Abseil`'s internals will allow us to delete `absl/base/internal/invoke.h`.
PiperOrigin-RevId: 726051909
Change-Id: Ic571307c6e11d7b3e2a380255bd4c9be98e232f9
Linux "latest" containers updated to
GCC 14.2
CMake 3.31.2
Bazel 8.0.0
Included are various fixes to get these versions to work.
Bazel now references repositories by their canonical names from the
Bazel Central Registry. For example, Abseil is now @abseil-cpp instead
of @com_google_absl, and GoogleTest is now @googletest instead of
@com_google_googletest. Users still using the old WORKSPACE system may
need to use `repo_mapping` on repositories using the old names. See
`WORKSPACE.bazel` in this commit for an example.
PiperOrigin-RevId: 709102146
Change-Id: I02327ed4f8fb947766480bdeef2b1930a7f831eb
Prior to this change, some ABSL_HARDENING_ASSERTs were sequenced with the main
work of some constexpr methods using the comma operator in order to satisfy
C++11's constexpr requirements. However, putting the assertion and the main
work of the function on the same line complicates measuring the performance
impact of the assertions. As C++11 is no longer supported, this change moves
the assertions to their own lines in order to make measuring their performance
impact easier.
PiperOrigin-RevId: 707614464
Change-Id: Idb621bb183b80db17e2db44c3ffc671b76bba92b
_The implementation has not changed, only constexpr markers have been added._
PiperOrigin-RevId: 695435063
Change-Id: I66cd03195e429534c0e58c330f1019c89025abed
This allows containers that either optimize based on these
concepts or produce lifetime warnings based on them to
handle absl::Span appropriately. An example is Chromium's
base::span, which warns more aggressively about construction
from rvalues that are not borrowed ranges.
This only has an effect for codebases using C++20. While
many such codebases will presumably also be using std::span
directly, they may use absl::Span for backwards compat, or
compile against libraries that do so.
Also fixes lint's that fired when I tried to edit this.
PiperOrigin-RevId: 688552975
Change-Id: I603e04cd74d60ac6b65754ac73037d7f0ab457fe