| Index: include/private/SkTLogic.h
|
| diff --git a/include/private/SkTLogic.h b/include/private/SkTLogic.h
|
| index d188242446d0345af89e2fdc45da86de7c49f45f..7b95245d180916c5d84af2970d96a0565b8c3efc 100644
|
| --- a/include/private/SkTLogic.h
|
| +++ b/include/private/SkTLogic.h
|
| @@ -18,6 +18,8 @@
|
| #ifndef SkTLogic_DEFINED
|
| #define SkTLogic_DEFINED
|
|
|
| +#include <stdint.h>
|
| +
|
| /** Represents a templated integer constant.
|
| * Pre-C++11 version of std::integral_constant.
|
| */
|
| @@ -108,4 +110,30 @@ public: \
|
| static const bool value = sizeof(func<T>(NULL)) == sizeof(uint8_t); \
|
| }
|
|
|
| +/** SkTRemoveReference<T>::type is the type of T with any top-level lvalue or rvalue removed. */
|
| +template <typename T> struct SkTRemoveReference {
|
| + typedef T type;
|
| +};
|
| +template <typename T> struct SkTRemoveReference<T&> {
|
| + typedef T type;
|
| +};
|
| +template <typename T> struct SkTRemoveReference<T&&> {
|
| + typedef T type;
|
| +};
|
| +
|
| +/** SkTIsLValueReference<T>::value is true if the type T is an lvalue reference. */
|
| +template <typename T> struct SkTIsLValueReference : SkFalse {};
|
| +template <typename T> struct SkTIsLValueReference<T&> : SkTrue {};
|
| +
|
| +/**
|
| + * SkTIsConst<T>::value is true if the type T is const.
|
| + * The type T is constrained not to be an array or reference type.
|
| + */
|
| +template <typename T> struct SkTIsConst {
|
| + static T* t;
|
| + static uint16_t test(const volatile void*);
|
| + static uint32_t test(volatile void *);
|
| + static const bool value = (sizeof(uint16_t) == sizeof(test(t)));
|
| +};
|
| +
|
| #endif
|
|
|