summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-12-16 09:58:57 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-12-16 09:59:51 -0800
commit71927b43256b9252bfafffc951bcc8106156a811 (patch)
treeded7b81075edc686a9bad6b5cc07ac8e32da89eb
parentd5240fc53307c536ef6b469cf6dbedeb304eba06 (diff)
Replace absl::IsConvertibleHelper with std::is_convertible
PiperOrigin-RevId: 495898835 Change-Id: Id2150a0505020ac2be4487e904d167a26316260c
-rw-r--r--absl/types/internal/span.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/absl/types/internal/span.h b/absl/types/internal/span.h
index d653bb2c..344ad4db 100644
--- a/absl/types/internal/span.h
+++ b/absl/types/internal/span.h
@@ -99,28 +99,9 @@ bool LessThanImpl(SpanT<T> a, SpanT<T> b) {
return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end());
}
-// The `IsConvertible` classes here are needed because of the
-// `std::is_convertible` bug in libcxx when compiled with GCC. This build
-// configuration is used by Android NDK toolchain. Reference link:
-// https://bugs.llvm.org/show_bug.cgi?id=27538.
-template <typename From, typename To>
-struct IsConvertibleHelper {
- private:
- static std::true_type testval(To);
- static std::false_type testval(...);
-
- public:
- using type = decltype(testval(std::declval<From>()));
-};
-
-template <typename From, typename To>
-struct IsConvertible : IsConvertibleHelper<From, To>::type {};
-
-// TODO(zhangxy): replace `IsConvertible` with `std::is_convertible` once the
-// older version of libcxx is not supported.
template <typename From, typename To>
using EnableIfConvertibleTo =
- typename std::enable_if<IsConvertible<From, To>::value>::type;
+ typename std::enable_if<std::is_convertible<From, To>::value>::type;
// IsView is true for types where the return type of .data() is the same for
// mutable and const instances. This isn't foolproof, but it's only used to