OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // is_class<Type> | 70 // is_class<Type> |
71 COMPILE_ASSERT(is_class<AStruct>::value, IsClass); | 71 COMPILE_ASSERT(is_class<AStruct>::value, IsClass); |
72 COMPILE_ASSERT(is_class<AClass>::value, IsClass); | 72 COMPILE_ASSERT(is_class<AClass>::value, IsClass); |
73 COMPILE_ASSERT(!is_class<AnEnum>::value, IsClass); | 73 COMPILE_ASSERT(!is_class<AnEnum>::value, IsClass); |
74 COMPILE_ASSERT(!is_class<int>::value, IsClass); | 74 COMPILE_ASSERT(!is_class<int>::value, IsClass); |
75 COMPILE_ASSERT(!is_class<char*>::value, IsClass); | 75 COMPILE_ASSERT(!is_class<char*>::value, IsClass); |
76 COMPILE_ASSERT(!is_class<int&>::value, IsClass); | 76 COMPILE_ASSERT(!is_class<int&>::value, IsClass); |
77 COMPILE_ASSERT(!is_class<char[3]>::value, IsClass); | 77 COMPILE_ASSERT(!is_class<char[3]>::value, IsClass); |
78 | 78 |
| 79 |
| 80 COMPILE_ASSERT(!is_member_function_pointer<int>::value, |
| 81 IsMemberFunctionPointer); |
| 82 COMPILE_ASSERT(!is_member_function_pointer<int*>::value, |
| 83 IsMemberFunctionPointer); |
| 84 COMPILE_ASSERT(!is_member_function_pointer<void*>::value, |
| 85 IsMemberFunctionPointer); |
| 86 COMPILE_ASSERT(!is_member_function_pointer<AStruct>::value, |
| 87 IsMemberFunctionPointer); |
| 88 COMPILE_ASSERT(!is_member_function_pointer<AStruct*>::value, |
| 89 IsMemberFunctionPointer); |
| 90 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int)>::value, |
| 91 IsMemberFunctionPointer); |
| 92 COMPILE_ASSERT(!is_member_function_pointer<int(*)(int, int)>::value, |
| 93 IsMemberFunctionPointer); |
| 94 |
| 95 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)()>::value, |
| 96 IsMemberFunctionPointer); |
| 97 COMPILE_ASSERT(is_member_function_pointer<void (AStruct::*)(int)>::value, |
| 98 IsMemberFunctionPointer); |
| 99 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int)>::value, |
| 100 IsMemberFunctionPointer); |
| 101 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int) const>::value, |
| 102 IsMemberFunctionPointer); |
| 103 COMPILE_ASSERT(is_member_function_pointer<int (AStruct::*)(int, int)>::value, |
| 104 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); |
| 128 |
79 } // namespace | 129 } // namespace |
80 } // namespace base | 130 } // namespace base |
OLD | NEW |