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

Side by Side Diff: base/template_util.h

Issue 7015064: Support binding WeakPtr<> to methods with void return types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a few comments. Created 9 years, 7 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 | « base/callback.h.pump ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TEMPLATE_UTIL_H_ 5 #ifndef BASE_TEMPLATE_UTIL_H_
6 #define BASE_TEMPLATE_UTIL_H_ 6 #define BASE_TEMPLATE_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <cstddef> // For size_t. 9 #include <cstddef> // For size_t.
10 10
11 #include "build/build_config.h" 11 #include "build/build_config.h"
(...skipping 18 matching lines...) Expand all
30 template <class T> struct is_pointer<T*> : true_type {}; 30 template <class T> struct is_pointer<T*> : true_type {};
31 31
32 template<class> struct is_array : public false_type {}; 32 template<class> struct is_array : public false_type {};
33 template<class T, size_t n> struct is_array<T[n]> : public true_type {}; 33 template<class T, size_t n> struct is_array<T[n]> : public true_type {};
34 template<class T> struct is_array<T[]> : public true_type {}; 34 template<class T> struct is_array<T[]> : public true_type {};
35 35
36 template <class T> struct is_non_const_reference : false_type {}; 36 template <class T> struct is_non_const_reference : false_type {};
37 template <class T> struct is_non_const_reference<T&> : true_type {}; 37 template <class T> struct is_non_const_reference<T&> : true_type {};
38 template <class T> struct is_non_const_reference<const T&> : false_type {}; 38 template <class T> struct is_non_const_reference<const T&> : false_type {};
39 39
40 template <class T> struct is_void : false_type {};
41 template <> struct is_void<void> : true_type {};
42
40 namespace internal { 43 namespace internal {
41 44
42 // Types YesType and NoType are guaranteed such that sizeof(YesType) < 45 // Types YesType and NoType are guaranteed such that sizeof(YesType) <
43 // sizeof(NoType). 46 // sizeof(NoType).
44 typedef char YesType; 47 typedef char YesType;
45 48
46 struct NoType { 49 struct NoType {
47 YesType dummy[2]; 50 YesType dummy[2];
48 }; 51 };
49 52
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 template <typename T> 97 template <typename T>
95 struct is_class 98 struct is_class
96 : integral_constant<bool, 99 : integral_constant<bool,
97 sizeof(internal::IsClassHelper::Test<T>(0)) == 100 sizeof(internal::IsClassHelper::Test<T>(0)) ==
98 sizeof(internal::YesType)> { 101 sizeof(internal::YesType)> {
99 }; 102 };
100 103
101 } // namespace base 104 } // namespace base
102 105
103 #endif // BASE_TEMPLATE_UTIL_H_ 106 #endif // BASE_TEMPLATE_UTIL_H_
OLDNEW
« no previous file with comments | « base/callback.h.pump ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698