From 71927b43256b9252bfafffc951bcc8106156a811 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 16 Dec 2022 09:58:57 -0800 Subject: Replace absl::IsConvertibleHelper with std::is_convertible PiperOrigin-RevId: 495898835 Change-Id: Id2150a0505020ac2be4487e904d167a26316260c --- absl/types/internal/span.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'absl/types') 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 a, SpanT 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 -struct IsConvertibleHelper { - private: - static std::true_type testval(To); - static std::false_type testval(...); - - public: - using type = decltype(testval(std::declval())); -}; - -template -struct IsConvertible : IsConvertibleHelper::type {}; - -// TODO(zhangxy): replace `IsConvertible` with `std::is_convertible` once the -// older version of libcxx is not supported. template using EnableIfConvertibleTo = - typename std::enable_if::value>::type; + typename std::enable_if::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 -- cgit v1.2.3