llvm.org GIT mirror llvm / e9b2cf3
Add operator== and operator!= to compare with nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210100 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
240240 return A != B.getPtr();
241241 }
242242
243 template
244 bool operator==(std::nullptr_t A, const IntrusiveRefCntPtr &B) {
245 return !B;
246 }
247
248 template
249 bool operator==(const IntrusiveRefCntPtr &A, std::nullptr_t B) {
250 return !A;
251 }
252
253 template
254 bool operator!=(std::nullptr_t A, const IntrusiveRefCntPtr &B) {
255 return !(A == B);
256 }
257
258 template
259 bool operator!=(const IntrusiveRefCntPtr &A, std::nullptr_t B) {
260 return !(A == B);
261 }
262
243263 //===----------------------------------------------------------------------===//
244264 // LLVM-style downcasting support for IntrusiveRefCntPtr objects
245265 //===----------------------------------------------------------------------===//