From ccb8e8bf38f51e35e0a456c6a724bab96d1b657a Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 15 Nov 2016 11:56:56 -0500 Subject: 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 Reviewed-by: Brian Osman Reviewed-by: Mike Klein --- src/core/SkFixedAlloc.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/SkFixedAlloc.h b/src/core/SkFixedAlloc.h index 0f450576d9..504783c2e0 100644 --- a/src/core/SkFixedAlloc.h +++ b/src/core/SkFixedAlloc.h @@ -15,13 +15,16 @@ #include #include -// 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 - using is_trivially_copyable = has_trivial_copy_constructor; - } -#endif + using is_trivially_copyable = std::has_trivial_copy_constructor; + #else + template + using is_trivially_copyable = std::is_trivially_copyable; + #endif +} // SkFixedAlloc allocates POD objects out of a fixed-size buffer. class SkFixedAlloc { @@ -32,8 +35,7 @@ public: // Allocates space suitable for a T. If we can't, returns nullptr. template void* alloc() { - static_assert(std::is_standard_layout ::value - && std::is_trivially_copyable::value, ""); + static_assert(std::is_standard_layout::value && is_trivially_copyable::value, ""); return this->alloc(sizeof(T), alignof(T)); } -- cgit v1.2.3