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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 template<typename T> struct IsFloatingPoint { static const bool value =
false; }; | 79 template<typename T> struct IsFloatingPoint { static const bool value =
false; }; |
80 template<> struct IsFloatingPoint<float> { static const bool value =
true; }; | 80 template<> struct IsFloatingPoint<float> { static const bool value =
true; }; |
81 template<> struct IsFloatingPoint<double> { static const bool value =
true; }; | 81 template<> struct IsFloatingPoint<double> { static const bool value =
true; }; |
82 template<> struct IsFloatingPoint<long double> { static const bool value =
true; }; | 82 template<> struct IsFloatingPoint<long double> { static const bool value =
true; }; |
83 | 83 |
84 template<typename T> struct ValidArgumentTypeTrait { static const bool value
= true; }; | 84 template<typename T> struct ValidArgumentTypeTrait { static const bool value
= true; }; |
85 | 85 |
86 template<typename T> struct IsArithmetic { static const bool value =
IsInteger<T>::value || IsFloatingPoint<T>::value; }; | 86 template<typename T> struct IsArithmetic { static const bool value =
IsInteger<T>::value || IsFloatingPoint<T>::value; }; |
87 | 87 |
88 template<typename T> struct NeedsVisiting { static const bool value =
false; }; | 88 template<typename T> struct NeedsTracing { static const bool value =
false; }; |
89 template<typename T> struct IsWeak { static const bool value =
false; }; | 89 template<typename T> struct IsWeak { static const bool value =
false; }; |
90 | 90 |
91 // IsPod is misnamed as it doesn't cover all plain old data (pod) types. | 91 // IsPod is misnamed as it doesn't cover all plain old data (pod) types. |
92 // Specifically, it doesn't allow for enums or for structs. | 92 // Specifically, it doesn't allow for enums or for structs. |
93 template <typename T> struct IsPod { static const bool value =
IsArithmetic<T>::value; }; | 93 template <typename T> struct IsPod { static const bool value =
IsArithmetic<T>::value; }; |
94 template <typename P> struct IsPod<P*> { static const bool value =
true; }; | 94 template <typename P> struct IsPod<P*> { static const bool value =
true; }; |
95 | 95 |
96 template<typename T> class IsConvertibleToInteger { | 96 template<typename T> class IsConvertibleToInteger { |
97 // Avoid "possible loss of data" warning when using Microsoft's C++ comp
iler | 97 // Avoid "possible loss of data" warning when using Microsoft's C++ comp
iler |
98 // by not converting int's to doubles. | 98 // by not converting int's to doubles. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 static const bool value = IsPod<RemoveConstVolatile<T> >::value; | 257 static const bool value = IsPod<RemoveConstVolatile<T> >::value; |
258 }; | 258 }; |
259 template <typename T> struct HasTrivialDestructor { | 259 template <typename T> struct HasTrivialDestructor { |
260 static const bool value = IsPod<RemoveConstVolatile<T> >::value; | 260 static const bool value = IsPod<RemoveConstVolatile<T> >::value; |
261 }; | 261 }; |
262 #endif | 262 #endif |
263 | 263 |
264 } // namespace WTF | 264 } // namespace WTF |
265 | 265 |
266 #endif // TypeTraits_h | 266 #endif // TypeTraits_h |
OLD | NEW |