Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/wtf/TypeTraits.h

Issue 319593004: Oilpan:Allow custom handling of classes that contain weak pointers that are embedded in collections. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove 'typename' that Win compiler does not like Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/wtf/ListHashSet.h ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/wtf/ListHashSet.h ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698