Index: src/utils/SkTLogic.h |
diff --git a/src/utils/SkTLogic.h b/src/utils/SkTLogic.h |
index 925d4bdcd4fb3d514d0197f10d5815165aa120e6..2b5df0b16fe866559a846790ae1ecef380cfda38 100644 |
--- a/src/utils/SkTLogic.h |
+++ b/src/utils/SkTLogic.h |
@@ -30,6 +30,14 @@ template <typename T, T v> struct SkTIntegralConstant { |
/** Convenience specialization of SkTIntegralConstant. */ |
template <bool b> struct SkTBool : SkTIntegralConstant<bool, b> { }; |
+/** Pre-C++11 version of std::is_empty<T>. */ |
+template <typename T> |
+class SkTIsEmpty { |
+ struct Derived : public T { char unused; }; |
+public: |
+ static const bool value = sizeof(Derived) == sizeof(char); |
+}; |
+ |
/** Pre-C++11 version of std::true_type. */ |
typedef SkTBool<true> SkTrue; |