Index: Source/wtf/TypeTraits.h |
diff --git a/Source/wtf/TypeTraits.h b/Source/wtf/TypeTraits.h |
index 908f06cf91733e16c98e16f9f751b478e1d138ec..3637304b4680f221d39d09d3591ca9157513150e 100644 |
--- a/Source/wtf/TypeTraits.h |
+++ b/Source/wtf/TypeTraits.h |
@@ -29,7 +29,7 @@ |
// The following are provided in this file: |
// |
// IsInteger<T>::value |
- // IsPod<T>::value |
+ // IsPod<T>::value, see the definition for a note about its limitations |
// IsConvertibleToInteger<T>::value |
// |
// IsArray<T>::value |
@@ -72,26 +72,6 @@ |
template<typename T> struct IsArithmetic { static const bool value = IsInteger<T>::value || IsFloatingPoint<T>::value; }; |
- template<typename T> struct IsPointer { |
- static const bool value = false; |
- }; |
- |
- template<typename P> struct IsPointer<const P*> { |
- static const bool value = true; |
- }; |
- |
- template<typename P> struct IsPointer<P*> { |
- static const bool value = true; |
- }; |
- |
- template<typename T> struct IsEnum { |
- static const bool value = __is_enum(T); |
- }; |
- |
- template<typename T> struct IsScalar { |
- static const bool value = IsEnum<T>::value || IsArithmetic<T>::value || IsPointer<T>::value; |
- }; |
- |
template<typename T> struct IsWeak { static const bool value = false; }; |
enum WeakHandlingFlag { |
@@ -99,25 +79,10 @@ |
WeakHandlingInCollections |
}; |
- template <typename T> struct IsPod { |
- static const bool value = __is_pod(T); |
- }; |
- |
- template <typename T> struct IsTriviallyCopyAssignable { |
- static const bool value = __has_trivial_assign(T); |
- }; |
- |
- template <typename T> struct IsTriviallyMoveAssignable { |
- static const bool value = __has_trivial_assign(T); |
- }; |
- |
- template <typename T> struct IsTriviallyDefaultConstructible { |
- static const bool value = __has_trivial_constructor(T); |
- }; |
- |
- template <typename T> struct IsTriviallyDestructible { |
- static const bool value = __has_trivial_destructor(T); |
- }; |
+ // IsPod is misnamed as it doesn't cover all plain old data (pod) types. |
+ // Specifically, it doesn't allow for enums or for structs. |
+ template <typename T> struct IsPod { static const bool value = IsArithmetic<T>::value; }; |
+ template <typename P> struct IsPod<P*> { static const bool value = true; }; |
template<typename T> class IsConvertibleToInteger { |
// Avoid "possible loss of data" warning when using Microsoft's C++ compiler |