| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 template<class T, size_t n> struct is_array<T[n]> : public true_type {}; | 41 template<class T, size_t n> struct is_array<T[n]> : public true_type {}; |
| 42 template<class T> struct is_array<T[]> : public true_type {}; | 42 template<class T> struct is_array<T[]> : public true_type {}; |
| 43 | 43 |
| 44 template <class T> struct is_non_const_reference : false_type {}; | 44 template <class T> struct is_non_const_reference : false_type {}; |
| 45 template <class T> struct is_non_const_reference<T&> : true_type {}; | 45 template <class T> struct is_non_const_reference<T&> : true_type {}; |
| 46 template <class T> struct is_non_const_reference<const T&> : false_type {}; | 46 template <class T> struct is_non_const_reference<const T&> : false_type {}; |
| 47 | 47 |
| 48 template <class T> struct is_void : false_type {}; | 48 template <class T> struct is_void : false_type {}; |
| 49 template <> struct is_void<void> : true_type {}; | 49 template <> struct is_void<void> : true_type {}; |
| 50 | 50 |
| 51 template <class T> |
| 52 struct remove_reference { |
| 53 typedef T type; |
| 54 }; |
| 55 template <class T> |
| 56 struct remove_reference<T&> { |
| 57 typedef T type; |
| 58 }; |
| 59 template <class T> |
| 60 struct remove_reference<T&&> { |
| 61 typedef T type; |
| 62 }; |
| 63 |
| 51 namespace internal { | 64 namespace internal { |
| 52 | 65 |
| 53 // Types YesType and NoType are guaranteed such that sizeof(YesType) < | 66 // Types YesType and NoType are guaranteed such that sizeof(YesType) < |
| 54 // sizeof(NoType). | 67 // sizeof(NoType). |
| 55 typedef char YesType; | 68 typedef char YesType; |
| 56 | 69 |
| 57 struct NoType { | 70 struct NoType { |
| 58 YesType dummy[2]; | 71 YesType dummy[2]; |
| 59 }; | 72 }; |
| 60 | 73 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 template <typename T> | 118 template <typename T> |
| 106 struct is_class | 119 struct is_class |
| 107 : integral_constant<bool, | 120 : integral_constant<bool, |
| 108 sizeof(internal::IsClassHelper::Test<T>(0)) == | 121 sizeof(internal::IsClassHelper::Test<T>(0)) == |
| 109 sizeof(internal::YesType)> { | 122 sizeof(internal::YesType)> { |
| 110 }; | 123 }; |
| 111 | 124 |
| 112 } // namespace rtc | 125 } // namespace rtc |
| 113 | 126 |
| 114 #endif // WEBRTC_BASE_TEMPLATE_UTIL_H_ | 127 #endif // WEBRTC_BASE_TEMPLATE_UTIL_H_ |
| OLD | NEW |