summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-04-02 23:41:16 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-04-02 23:42:08 -0700
commitd5e426097680beafbf72d6c88f50a680736ec770 (patch)
tree02802f874543540fe27294a3547faafb5c0ac3cf
parent643c7bab4994d720125fb30e8fb3a10e99bcbb47 (diff)
Temporarily revert dangling std::string_view detection until dependent is fixed
PiperOrigin-RevId: 621413395 Change-Id: I20e9fac94e81e59c0d723f115670c8cf68e9b44a
-rw-r--r--absl/meta/type_traits.h5
-rw-r--r--absl/meta/type_traits_test.cc6
-rw-r--r--absl/strings/string_view.h1
-rw-r--r--absl/strings/string_view_test.cc8
4 files changed, 0 insertions, 20 deletions
diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h
index ded55820..a1be47f1 100644
--- a/absl/meta/type_traits.h
+++ b/absl/meta/type_traits.h
@@ -630,11 +630,6 @@ template <typename T>
struct IsView : std::integral_constant<bool, std::is_pointer<T>::value ||
IsViewImpl<T>::value> {};
-#ifdef ABSL_HAVE_STD_STRING_VIEW
-template <typename Char, typename Traits>
-struct IsView<std::basic_string_view<Char, Traits>> : std::true_type {};
-#endif
-
#ifdef __cpp_lib_span
template <typename T>
struct IsView<std::span<T>> : std::true_type {};
diff --git a/absl/meta/type_traits_test.cc b/absl/meta/type_traits_test.cc
index 1e056bb2..e4107e53 100644
--- a/absl/meta/type_traits_test.cc
+++ b/absl/meta/type_traits_test.cc
@@ -45,12 +45,6 @@ static_assert(IsOwnerAndNotView<std::string>::value,
"string is an owner, not a view");
static_assert(IsOwnerAndNotView<std::wstring>::value,
"wstring is an owner, not a view");
-#ifdef ABSL_HAVE_STD_STRING_VIEW
-static_assert(!IsOwnerAndNotView<std::string_view>::value,
- "string_view is a view, not an owner");
-static_assert(!IsOwnerAndNotView<std::wstring_view>::value,
- "wstring_view is a view, not an owner");
-#endif
template <class T, class U>
struct simple_pair {
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
index b1fb7a10..b393c6fc 100644
--- a/absl/strings/string_view.h
+++ b/absl/strings/string_view.h
@@ -173,7 +173,6 @@ 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);
diff --git a/absl/strings/string_view_test.cc b/absl/strings/string_view_test.cc
index e978fc3f..1c73943e 100644
--- a/absl/strings/string_view_test.cc
+++ b/absl/strings/string_view_test.cc
@@ -47,14 +47,6 @@
namespace {
-static_assert(!absl::type_traits_internal::IsOwner<absl::string_view>::value &&
- absl::type_traits_internal::IsView<absl::string_view>::value,
- "string_view is a view, not an owner");
-
-static_assert(absl::type_traits_internal::IsLifetimeBoundAssignment<
- absl::string_view, std::string>::value,
- "lifetimebound assignment not detected");
-
// A minimal allocator that uses malloc().
template <typename T>
struct Mallocator {