aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-15 11:56:56 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-15 17:33:20 +0000
commitccb8e8bf38f51e35e0a456c6a724bab96d1b657a (patch)
treeb675ec26895f9b6377fd4e575153d4130c36fe0d /src/core
parent584ca89d3b7a7781ea0407ee4d1c953fc7085e75 (diff)
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>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkFixedAlloc.h18
1 files changed, 10 insertions, 8 deletions
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 <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 @@ public:
// 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));
}