summaryrefslogtreecommitdiff
path: root/absl/strings/string_view.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-04-02 09:03:50 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-04-02 09:04:52 -0700
commit5953a4885ae8dc4baa3f66292d6519e0ec254313 (patch)
tree1e93b3aa12a6d30806e0f7ba5d3ba61f562dee73 /absl/strings/string_view.h
parentd1dd9cd60a7167bc6e2f34877660e747e5b92842 (diff)
Add internal traits to absl::string_view for lifetimebound detection
This helps compilers that understand `ABSL_ATTRIBUTE_LIFETIME_BOUND` flag constructs such as `absl::StatusOr<std::string_view> str = std::string(...)` as error-prone. PiperOrigin-RevId: 621196818 Change-Id: I78d4c66854cde9d06eaaec05869d956376109d9c
Diffstat (limited to 'absl/strings/string_view.h')
-rw-r--r--absl/strings/string_view.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
index b393c6fc..b1fb7a10 100644
--- a/absl/strings/string_view.h
+++ b/absl/strings/string_view.h
@@ -173,6 +173,7 @@ class string_view {
using reverse_iterator = const_reverse_iterator;
using size_type = size_t;
using difference_type = std::ptrdiff_t;
+ using absl_internal_is_view = std::true_type;
static constexpr size_type npos = static_cast<size_type>(-1);