OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reser
ved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reser
ved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, U* b) | 131 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, U* b) |
132 { | 132 { |
133 return a.get() == b; | 133 return a.get() == b; |
134 } | 134 } |
135 | 135 |
136 template<typename T, typename U> inline bool operator==(T* a, const PassRefP
tr<U>& b) | 136 template<typename T, typename U> inline bool operator==(T* a, const PassRefP
tr<U>& b) |
137 { | 137 { |
138 return a == b.get(); | 138 return a == b.get(); |
139 } | 139 } |
140 | 140 |
| 141 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, const U& b) |
| 142 { |
| 143 return a.get() == &b; |
| 144 } |
| 145 |
| 146 template<typename T, typename U> inline bool operator==(const T& a, const Pa
ssRefPtr<U>& b) |
| 147 { |
| 148 return &a == b.get(); |
| 149 } |
| 150 |
141 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, const RawPtr<U>& b) | 151 template<typename T, typename U> inline bool operator==(const PassRefPtr<T>&
a, const RawPtr<U>& b) |
142 { | 152 { |
143 return a.get() == b.get(); | 153 return a.get() == b.get(); |
144 } | 154 } |
145 | 155 |
146 template<typename T, typename U> inline bool operator==(const RawPtr<T>& a,
const PassRefPtr<U>& b) | 156 template<typename T, typename U> inline bool operator==(const RawPtr<T>& a,
const PassRefPtr<U>& b) |
147 { | 157 { |
148 return a.get() == b.get(); | 158 return a.get() == b.get(); |
149 } | 159 } |
150 | 160 |
(...skipping 15 matching lines...) Expand all Loading... |
166 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, U* b) | 176 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, U* b) |
167 { | 177 { |
168 return a.get() != b; | 178 return a.get() != b; |
169 } | 179 } |
170 | 180 |
171 template<typename T, typename U> inline bool operator!=(T* a, const PassRefP
tr<U>& b) | 181 template<typename T, typename U> inline bool operator!=(T* a, const PassRefP
tr<U>& b) |
172 { | 182 { |
173 return a != b.get(); | 183 return a != b.get(); |
174 } | 184 } |
175 | 185 |
| 186 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const U& b) |
| 187 { |
| 188 return a.get() != &b; |
| 189 } |
| 190 |
| 191 template<typename T, typename U> inline bool operator!=(const T& a, const Pa
ssRefPtr<U>& b) |
| 192 { |
| 193 return &a != b.get(); |
| 194 } |
| 195 |
176 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const RawPtr<U>& b) | 196 template<typename T, typename U> inline bool operator!=(const PassRefPtr<T>&
a, const RawPtr<U>& b) |
177 { | 197 { |
178 return a.get() != b.get(); | 198 return a.get() != b.get(); |
179 } | 199 } |
180 | 200 |
181 template<typename T, typename U> inline bool operator!=(const RawPtr<T>& a,
const PassRefPtr<U>& b) | 201 template<typename T, typename U> inline bool operator!=(const RawPtr<T>& a,
const PassRefPtr<U>& b) |
182 { | 202 { |
183 return a.get() != b.get(); | 203 return a.get() != b.get(); |
184 } | 204 } |
185 | 205 |
(...skipping 13 matching lines...) Expand all Loading... |
199 return p.get(); | 219 return p.get(); |
200 } | 220 } |
201 | 221 |
202 } // namespace WTF | 222 } // namespace WTF |
203 | 223 |
204 using WTF::PassRefPtr; | 224 using WTF::PassRefPtr; |
205 using WTF::adoptRef; | 225 using WTF::adoptRef; |
206 using WTF::static_pointer_cast; | 226 using WTF::static_pointer_cast; |
207 | 227 |
208 #endif // WTF_PassRefPtr_h | 228 #endif // WTF_PassRefPtr_h |
OLD | NEW |