| OLD | NEW |
| 1 // Copyright (c) 2011 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 | 7 |
| 8 #include <cstddef> // For size_t. | 8 #include <cstddef> // For size_t. |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 sizeof(internal::YesType)> { | 110 sizeof(internal::YesType)> { |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 template <typename T> | 113 template <typename T> |
| 114 struct is_class | 114 struct is_class |
| 115 : integral_constant<bool, | 115 : integral_constant<bool, |
| 116 sizeof(internal::IsClassHelper::Test<T>(0)) == | 116 sizeof(internal::IsClassHelper::Test<T>(0)) == |
| 117 sizeof(internal::YesType)> { | 117 sizeof(internal::YesType)> { |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 template<bool B, class T = void> | |
| 121 struct enable_if {}; | |
| 122 | |
| 123 template<class T> | |
| 124 struct enable_if<true, T> { typedef T type; }; | |
| 125 | |
| 126 } // namespace base | 120 } // namespace base |
| 127 | 121 |
| 128 #endif // BASE_TEMPLATE_UTIL_H_ | 122 #endif // BASE_TEMPLATE_UTIL_H_ |
| OLD | NEW |