refcnt.hh (7866:31a04e5ac4be) | refcnt.hh (8220:d9f19c39ddba) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 83 unchanged lines hidden (view full) --- 92 const RefCountingPtr &operator=(const RefCountingPtr &r) 93 { return operator=(r.data); } 94 95 bool operator!() const { return data == 0; } 96 operator bool() const { return data != 0; } 97}; 98 99template<class T> | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 83 unchanged lines hidden (view full) --- 92 const RefCountingPtr &operator=(const RefCountingPtr &r) 93 { return operator=(r.data); } 94 95 bool operator!() const { return data == 0; } 96 operator bool() const { return data != 0; } 97}; 98 99template<class T> |
100bool operator==(const RefCountingPtr | 100inline bool operator==(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r) |
101{ return l.get() == r.get(); } 102 103template<class T> | 101{ return l.get() == r.get(); } 102 103template<class T> |
104bool operator==(const RefCountingPtr | 104inline bool operator==(const RefCountingPtr<T> &l, const T *r) |
105{ return l.get() == r; } 106 107template<class T> | 105{ return l.get() == r; } 106 107template<class T> |
108bool operator==(const T *l, const RefCountingPtr | 108inline bool operator==(const T *l, const RefCountingPtr<T> &r) |
109{ return l == r.get(); } 110 111template<class T> | 109{ return l == r.get(); } 110 111template<class T> |
112bool operator!=(const RefCountingPtr | 112inline bool operator!=(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r) |
113{ return l.get() != r.get(); } 114 115template<class T> | 113{ return l.get() != r.get(); } 114 115template<class T> |
116bool operator!=(const RefCountingPtr | 116inline bool operator!=(const RefCountingPtr<T> &l, const T *r) |
117{ return l.get() != r; } 118 119template<class T> | 117{ return l.get() != r; } 118 119template<class T> |
120bool operator!=(const T *l, const RefCountingPtr | 120inline bool operator!=(const T *l, const RefCountingPtr<T> &r) |
121{ return l != r.get(); } 122 123#endif // __BASE_REFCNT_HH__ | 121{ return l != r.get(); } 122 123#endif // __BASE_REFCNT_HH__ |