Changeset 12232 in webkit for trunk/JavaScriptCore/kxmlcore/HashTraits.h
- Timestamp:
- Jan 19, 2006, 12:59:03 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kxmlcore/HashTraits.h
r12162 r12232 45 45 template <> struct IsInteger<unsigned long long> { static const bool value = true; }; 46 46 47 template<typename T> struct GenericHashTraits { 47 template<bool isInteger, typename T> struct GenericHashTraitsBase; 48 template<typename T> struct GenericHashTraitsBase<true, T> { 48 49 typedef T TraitType; 49 static const bool emptyValueIsZero = IsInteger<T>::value;50 static const bool needsDestruction = !IsInteger<T>::value;51 static TraitType emptyValue() { return IsInteger<T>::value ? 0 : TraitType(); }50 static const bool emptyValueIsZero = true; 51 static const bool needsDestruction = false; 52 static TraitType emptyValue() { return 0; } 52 53 }; 54 template<typename T> struct GenericHashTraitsBase<false, T> { 55 typedef T TraitType; 56 static const bool emptyValueIsZero = false; 57 static const bool needsDestruction = true; 58 static TraitType emptyValue() { return TraitType(); } 59 }; 60 61 template<typename T> struct GenericHashTraits : GenericHashTraitsBase<IsInteger<T>::value, T> { }; 53 62 54 63 template<typename T> struct HashTraits : GenericHashTraits<T> { };
Note:
See TracChangeset
for help on using the changeset viewer.