Chromium Code Reviews| Index: src/utils/SkTLogic.h |
| diff --git a/src/utils/SkTLogic.h b/src/utils/SkTLogic.h |
| index 925d4bdcd4fb3d514d0197f10d5815165aa120e6..e89d7431962b3417babb32d59cbf5643f21ae890 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> { }; |
| +/** Is T an empty class? */ |
|
bungeman-skia
2014/05/07 15:33:42
Since the other ones also say something like it,
mtklein
2014/05/07 15:36:44
Done.
|
| +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; |