Changeset 11719 in webkit for trunk/JavaScriptCore/kxmlcore/HashTraits.h
- Timestamp:
- Dec 21, 2005, 4:55:34 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kxmlcore/HashTraits.h
r11628 r11719 25 25 26 26 #include <utility> 27 #ifndef WIN3228 #include <bits/cpp_type_traits.h>29 #endif30 27 31 28 namespace KXMLCore { 32 29 33 30 using std::pair; 34 35 // FIXME: stop using this evil hack, use something supported or else specialize 36 // for all numerit cypes by hand 31 32 template <typename T> struct IsInteger { static const bool value = false; }; 33 template <> struct IsInteger<bool> { static const bool value = true; }; 34 template <> struct IsInteger<char> { static const bool value = true; }; 35 template <> struct IsInteger<signed char> { static const bool value = true; }; 36 template <> struct IsInteger<unsigned char> { static const bool value = true; }; 37 template <> struct IsInteger<short> { static const bool value = true; }; 38 template <> struct IsInteger<unsigned short> { static const bool value = true; }; 39 template <> struct IsInteger<int> { static const bool value = true; }; 40 template <> struct IsInteger<unsigned int> { static const bool value = true; }; 41 template <> struct IsInteger<long> { static const bool value = true; }; 42 template <> struct IsInteger<unsigned long> { static const bool value = true; }; 43 template <> struct IsInteger<long long> { static const bool value = true; }; 44 template <> struct IsInteger<unsigned long long> { static const bool value = true; }; 45 37 46 template<typename T> 38 47 struct HashTraits { 39 48 typedef T traitType; 40 #ifdef __GLIBCXX__ // gcc 3.4 and greater: 41 static const bool emptyValueIsZero = std::__is_integer<T>::__value; 42 #else 43 static const bool emptyValueIsZero = std::__is_integer<T>::_M_type; 44 #endif 49 static const bool emptyValueIsZero = IsInteger<T>::value; 45 50 46 51 static traitType emptyValue() {
Note:
See TracChangeset
for help on using the changeset viewer.