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

Side by Side Diff: base/template_util_unittest.cc

Issue 598223003: Update base::is_member_function_pointer to use variadic templates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 6 years, 3 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
« no previous file with comments | « base/template_util.h ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/template_util.h" 5 #include "base/template_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 COMPILE_ASSERT(!is_member_function_pointer<int>::value, 80 COMPILE_ASSERT(!is_member_function_pointer<int>::value,
81 IsMemberFunctionPointer); 81 IsMemberFunctionPointer);
82 COMPILE_ASSERT(!is_member_function_pointer<int*>::value, 82 COMPILE_ASSERT(!is_member_function_pointer<int*>::value,
83 IsMemberFunctionPointer); 83 IsMemberFunctionPointer);
84 COMPILE_ASSERT(!is_member_function_pointer<void*>::value, 84 COMPILE_ASSERT(!is_member_function_pointer<void*>::value,
85 IsMemberFunctionPointer); 85 IsMemberFunctionPointer);
86 COMPILE_ASSERT(!is_member_function_pointer<AStruct>::value, 86 COMPILE_ASSERT(!is_member_function_pointer<AStruct>::value,
87 IsMemberFunctionPointer); 87 IsMemberFunctionPointer);
88 COMPILE_ASSERT(!is_member_function_pointer<AStruct*>::value, 88 COMPILE_ASSERT(!is_member_function_pointer<AStruct*>::value,
89 IsMemberFunctionPointer); 89 IsMemberFunctionPointer);
90 COMPILE_ASSERT(!is_member_function_pointer<void(*)()>::value,
91 IsMemberFunctionPointer);
90 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int)>::value, 92 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int)>::value,
91 IsMemberFunctionPointer); 93 IsMemberFunctionPointer);
92 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int, int)>::value, 94 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int, int)>::value,
93 IsMemberFunctionPointer); 95 IsMemberFunctionPointer);
94 96
95 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)()>::value, 97 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)()>::value,
96 IsMemberFunctionPointer); 98 IsMemberFunctionPointer);
97 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)(int)>::value, 99 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)(int)>::value,
98 IsMemberFunctionPointer); 100 IsMemberFunctionPointer);
99 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int)>::value, 101 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int)>::value,
100 IsMemberFunctionPointer); 102 IsMemberFunctionPointer);
101 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int) const>::value, 103 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int) const>::value,
102 IsMemberFunctionPointer); 104 IsMemberFunctionPointer);
103 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int, int)>::value, 105 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int, int)>::value,
104 IsMemberFunctionPointer); 106 IsMemberFunctionPointer);
105 COMPILE_ASSERT(is_member_function_pointer<
106 int (AStruct::*)(int, int) const>::value,
107 IsMemberFunctionPointer);
108 COMPILE_ASSERT(is_member_function_pointer<
109 int (AStruct::*)(int, int, int)>::value,
110 IsMemberFunctionPointer);
111 COMPILE_ASSERT(is_member_function_pointer<
112 int (AStruct::*)(int, int, int) const>::value,
113 IsMemberFunctionPointer);
114 COMPILE_ASSERT(is_member_function_pointer<
115 int (AStruct::*)(int, int, int, int)>::value,
116 IsMemberFunctionPointer);
117 COMPILE_ASSERT(is_member_function_pointer<
118 int (AStruct::*)(int, int, int, int) const>::value,
119 IsMemberFunctionPointer);
120
121 // False because we don't have a specialization for 5 params yet.
122 COMPILE_ASSERT(!is_member_function_pointer<
123 int (AStruct::*)(int, int, int, int, int)>::value,
124 IsMemberFunctionPointer);
125 COMPILE_ASSERT(!is_member_function_pointer<
126 int (AStruct::*)(int, int, int, int, int) const>::value,
127 IsMemberFunctionPointer);
Nico 2014/09/25 22:19:11 maybe keep this one (without "!")
Aaron Boodman 2014/09/25 22:34:41 But there's no reason now based on how this works
128 107
129 } // namespace 108 } // namespace
130 } // namespace base 109 } // namespace base
OLDNEW
« no previous file with comments | « base/template_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698