Rebase std::is_trivially_* with absl::is_trivially_*
std::is_trivially_* is not available on certain old STL
implementations. Using absl implementation will allow
maximized compatibility.
Bug: webrtc:10054
Change-Id: I17ed0fff44328b3d7c51d14e8c4470f1df0e66ad
Reviewed-on: https://webrtc-review.googlesource.com/c/111728
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25788}
diff --git a/rtc_base/sanitizer.h b/rtc_base/sanitizer.h
index a9eccfc..8af0824 100644
--- a/rtc_base/sanitizer.h
+++ b/rtc_base/sanitizer.h
@@ -14,7 +14,7 @@
#include <stddef.h> // For size_t.
#ifdef __cplusplus
-#include <type_traits>
+#include "absl/meta/type_traits.h"
#endif
#if defined(__has_feature)
@@ -98,10 +98,10 @@
template <typename T>
constexpr bool IsTriviallyCopyable() {
- return static_cast<bool>(std::is_trivially_copy_constructible<T>::value &&
- (std::is_trivially_copy_assignable<T>::value ||
+ return static_cast<bool>(absl::is_trivially_copy_constructible<T>::value &&
+ (absl::is_trivially_copy_assignable<T>::value ||
!std::is_copy_assignable<T>::value) &&
- std::is_trivially_destructible<T>::value);
+ absl::is_trivially_destructible<T>::value);
}
} // namespace sanitizer_impl