OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 #endif | 185 #endif |
186 | 186 |
187 template<typename T> inline void swap(OwnPtr<T>& a, OwnPtr<T>& b) | 187 template<typename T> inline void swap(OwnPtr<T>& a, OwnPtr<T>& b) |
188 { | 188 { |
189 a.swap(b); | 189 a.swap(b); |
190 } | 190 } |
191 | 191 |
192 template<typename T, typename U> inline bool operator==(const OwnPtr<T>& a,
U* b) | 192 template<typename T, typename U> inline bool operator==(const OwnPtr<T>& a,
U* b) |
193 { | 193 { |
194 return a.get() == b; | 194 return a.get() == b; |
195 } | 195 } |
196 | 196 |
197 template<typename T, typename U> inline bool operator==(T* a, const OwnPtr<U
>& b) | 197 template<typename T, typename U> inline bool operator==(T* a, const OwnPtr<U
>& b) |
198 { | 198 { |
199 return a == b.get(); | 199 return a == b.get(); |
200 } | 200 } |
201 | 201 |
202 template<typename T, typename U> inline bool operator!=(const OwnPtr<T>& a,
U* b) | 202 template<typename T, typename U> inline bool operator!=(const OwnPtr<T>& a,
U* b) |
203 { | 203 { |
204 return a.get() != b; | 204 return a.get() != b; |
205 } | 205 } |
206 | 206 |
207 template<typename T, typename U> inline bool operator!=(T* a, const OwnPtr<U
>& b) | 207 template<typename T, typename U> inline bool operator!=(T* a, const OwnPtr<U
>& b) |
208 { | 208 { |
209 return a != b.get(); | 209 return a != b.get(); |
210 } | 210 } |
211 | 211 |
212 template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr<
T>& p) | 212 template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr<
T>& p) |
213 { | 213 { |
214 return p.get(); | 214 return p.get(); |
215 } | 215 } |
216 | 216 |
217 } // namespace WTF | 217 } // namespace WTF |
218 | 218 |
219 using WTF::OwnPtr; | 219 using WTF::OwnPtr; |
220 | 220 |
221 #endif // WTF_OwnPtr_h | 221 #endif // WTF_OwnPtr_h |
OLD | NEW |