summaryrefslogtreecommitdiff
path: root/absl/status
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-10-18 08:24:39 -0700
committerGravatar Derek Mauro <dmauro@google.com>2021-10-18 15:06:33 -0400
commita2f52e1177b87bdc747f8d0b7745c8f967bceb9d (patch)
tree81fb235516b6034ebda5e1718dc9a69c7d176d47 /absl/status
parent7e446075d4aff4601c1e7627c7c0be2c4833a53a (diff)
Export of internal Abseil changes
-- b008f3aaab60f1f0eb5987b50336543cca7151be by Martijn Vels <mvels@google.com>: Enable Cord Btree as the default Cord implementation. The Cord Btree implementation has been extensively tested by google. This changes makes the Cord Btree implementation the default implementation. This change should have no impact on current use cases and does not effect any public API or behavior. PiperOrigin-RevId: 403966449 -- 3d82052b5819d1244942c59d5cb4e51d75ada287 by Derek Mauro <dmauro@google.com>: Add missing CMake alias for gmock_main. Remove unused variable ABSL_TEST_COMMON_LIBRARIES Fixes #709 Fixes #1043 PiperOrigin-RevId: 403950358 -- 86695f6d06915b56d807303c37ee81487998cd58 by Abseil Team <absl-team@google.com>: FunctionRef is cheaper to construct than a std::function, and the argument is only used during the call, so this is safe. This has the added advantage of allowing the caller to provide a non-movable callable, which can't be converted to a std::function. PiperOrigin-RevId: 403457615 -- 196c1109ba519d4ff00c856bbb4bff754468359f by Abseil Team <absl-team@google.com>: Internal optimization. PiperOrigin-RevId: 403413291 GitOrigin-RevId: b008f3aaab60f1f0eb5987b50336543cca7151be Change-Id: I1665f0efd484f53e0ed22d8940ef2fa60b03cc5b
Diffstat (limited to 'absl/status')
-rw-r--r--absl/status/BUILD.bazel1
-rw-r--r--absl/status/CMakeLists.txt1
-rw-r--r--absl/status/status.cc2
-rw-r--r--absl/status/status.h3
4 files changed, 5 insertions, 2 deletions
diff --git a/absl/status/BUILD.bazel b/absl/status/BUILD.bazel
index 0e5b3508..bae5156f 100644
--- a/absl/status/BUILD.bazel
+++ b/absl/status/BUILD.bazel
@@ -47,6 +47,7 @@ cc_library(
"//absl/container:inlined_vector",
"//absl/debugging:stacktrace",
"//absl/debugging:symbolize",
+ "//absl/functional:function_ref",
"//absl/strings",
"//absl/strings:cord",
"//absl/strings:str_format",
diff --git a/absl/status/CMakeLists.txt b/absl/status/CMakeLists.txt
index 43898564..f107c85b 100644
--- a/absl/status/CMakeLists.txt
+++ b/absl/status/CMakeLists.txt
@@ -29,6 +29,7 @@ absl_cc_library(
absl::atomic_hook
absl::config
absl::core_headers
+ absl::function_ref
absl::raw_logging_internal
absl::inlined_vector
absl::stacktrace
diff --git a/absl/status/status.cc b/absl/status/status.cc
index 53c198e1..bcf3413e 100644
--- a/absl/status/status.cc
+++ b/absl/status/status.cc
@@ -161,7 +161,7 @@ bool Status::ErasePayload(absl::string_view type_url) {
}
void Status::ForEachPayload(
- const std::function<void(absl::string_view, const absl::Cord&)>& visitor)
+ absl::FunctionRef<void(absl::string_view, const absl::Cord&)> visitor)
const {
if (auto* payloads = GetPayloads()) {
bool in_reverse =
diff --git a/absl/status/status.h b/absl/status/status.h
index 9bb45382..39071e5f 100644
--- a/absl/status/status.h
+++ b/absl/status/status.h
@@ -55,6 +55,7 @@
#include <string>
#include "absl/container/inlined_vector.h"
+#include "absl/functional/function_ref.h"
#include "absl/status/internal/status_internal.h"
#include "absl/strings/cord.h"
#include "absl/strings/string_view.h"
@@ -590,7 +591,7 @@ class Status final {
// NOTE: Any mutation on the same 'absl::Status' object during visitation is
// forbidden and could result in undefined behavior.
void ForEachPayload(
- const std::function<void(absl::string_view, const absl::Cord&)>& visitor)
+ absl::FunctionRef<void(absl::string_view, const absl::Cord&)> visitor)
const;
private: