| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 template<typename T> struct IsFloatingPoint { static const bool value =
false; }; | 66 template<typename T> struct IsFloatingPoint { static const bool value =
false; }; |
| 67 template<> struct IsFloatingPoint<float> { static const bool value =
true; }; | 67 template<> struct IsFloatingPoint<float> { static const bool value =
true; }; |
| 68 template<> struct IsFloatingPoint<double> { static const bool value =
true; }; | 68 template<> struct IsFloatingPoint<double> { static const bool value =
true; }; |
| 69 template<> struct IsFloatingPoint<long double> { static const bool value =
true; }; | 69 template<> struct IsFloatingPoint<long double> { static const bool value =
true; }; |
| 70 | 70 |
| 71 template<typename T> struct IsArithmetic { static const bool value =
IsInteger<T>::value || IsFloatingPoint<T>::value; }; | 71 template<typename T> struct IsArithmetic { static const bool value =
IsInteger<T>::value || IsFloatingPoint<T>::value; }; |
| 72 | 72 |
| 73 template<typename T> struct IsWeak { static const bool value =
false; }; | 73 template<typename T> struct IsWeak { static const bool value =
false; }; |
| 74 | 74 |
| 75 enum WeakHandlingFlag { |
| 76 NoWeakHandlingInCollections, |
| 77 WeakHandlingInCollections |
| 78 }; |
| 79 |
| 75 // IsPod is misnamed as it doesn't cover all plain old data (pod) types. | 80 // IsPod is misnamed as it doesn't cover all plain old data (pod) types. |
| 76 // Specifically, it doesn't allow for enums or for structs. | 81 // Specifically, it doesn't allow for enums or for structs. |
| 77 template <typename T> struct IsPod { static const bool value =
IsArithmetic<T>::value; }; | 82 template <typename T> struct IsPod { static const bool value =
IsArithmetic<T>::value; }; |
| 78 template <typename P> struct IsPod<P*> { static const bool value =
true; }; | 83 template <typename P> struct IsPod<P*> { static const bool value =
true; }; |
| 79 | 84 |
| 80 template<typename T> class IsConvertibleToInteger { | 85 template<typename T> class IsConvertibleToInteger { |
| 81 // Avoid "possible loss of data" warning when using Microsoft's C++ comp
iler | 86 // Avoid "possible loss of data" warning when using Microsoft's C++ comp
iler |
| 82 // by not converting int's to doubles. | 87 // by not converting int's to doubles. |
| 83 template<bool performCheck, typename U> class IsConvertibleToDouble; | 88 template<bool performCheck, typename U> class IsConvertibleToDouble; |
| 84 template<typename U> class IsConvertibleToDouble<false, U> { | 89 template<typename U> class IsConvertibleToDouble<false, U> { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // Collection Traits. It helps make the code more readable. | 328 // Collection Traits. It helps make the code more readable. |
| 324 template<typename Traits> | 329 template<typename Traits> |
| 325 class ShouldBeTraced { | 330 class ShouldBeTraced { |
| 326 public: | 331 public: |
| 327 static const bool value = Traits::template NeedsTracingLazily<>::value; | 332 static const bool value = Traits::template NeedsTracingLazily<>::value; |
| 328 }; | 333 }; |
| 329 | 334 |
| 330 } // namespace WTF | 335 } // namespace WTF |
| 331 | 336 |
| 332 #endif // TypeTraits_h | 337 #endif // TypeTraits_h |
| OLD | NEW |