fix google3?
TBR=brianosman@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4822
Change-Id: I991232e90c6851938151daa59cdeb4a3e22a7f03
Reviewed-on: https://skia-review.googlesource.com/4822
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/src/core/SkFixedAlloc.h b/src/core/SkFixedAlloc.h
index 0f45057..504783c 100644
--- a/src/core/SkFixedAlloc.h
+++ b/src/core/SkFixedAlloc.h
@@ -15,13 +15,16 @@
#include <utility>
#include <vector>
-// Before GCC 5, is_trivially_copyable had a pre-standard name.
-#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150801)
- namespace std {
+namespace {
+ // Before GCC 5, is_trivially_copyable had a pre-standard name.
+ #if defined(__GLIBCXX__)
template <typename T>
- using is_trivially_copyable = has_trivial_copy_constructor<T>;
- }
-#endif
+ using is_trivially_copyable = std::has_trivial_copy_constructor<T>;
+ #else
+ template <typename T>
+ using is_trivially_copyable = std::is_trivially_copyable<T>;
+ #endif
+}
// SkFixedAlloc allocates POD objects out of a fixed-size buffer.
class SkFixedAlloc {
@@ -32,8 +35,7 @@
// Allocates space suitable for a T. If we can't, returns nullptr.
template <typename T>
void* alloc() {
- static_assert(std::is_standard_layout <T>::value
- && std::is_trivially_copyable<T>::value, "");
+ static_assert(std::is_standard_layout<T>::value && is_trivially_copyable<T>::value, "");
return this->alloc(sizeof(T), alignof(T));
}