Lines Matching defs:scoped_refptr

232 //     scoped_refptr<MyFoo> foo = new MyFoo();
238 // scoped_refptr<MyFoo> foo = new MyFoo();
246 // The above examples show how scoped_refptr<T> acts like a pointer to T.
247 // Given two scoped_refptr<T> classes, it is also possible to exchange
251 // scoped_refptr<MyFoo> a = new MyFoo();
252 // scoped_refptr<MyFoo> b;
262 // scoped_refptr<MyFoo> a = new MyFoo();
263 // scoped_refptr<MyFoo> b;
270 class scoped_refptr {
274 scoped_refptr() : ptr_(NULL) {
277 scoped_refptr(T* p) : ptr_(p) {
282 scoped_refptr(const scoped_refptr<T>& r) : ptr_(r.ptr_) {
288 scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) {
293 ~scoped_refptr() {
301 // Allow scoped_refptr<C> to be used in boolean expression
316 scoped_refptr<T>& operator=(T* p) {
327 scoped_refptr<T>& operator=(const scoped_refptr<T>& r) {
332 scoped_refptr<T>& operator=(const scoped_refptr<U>& r) {
342 void swap(scoped_refptr<T>& r) {
348 bool operator==(const scoped_refptr<U>& rhs) const {
353 bool operator!=(const scoped_refptr<U>& rhs) const {
358 bool operator<(const scoped_refptr<U>& rhs) const {
367 // Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
370 scoped_refptr<T> make_scoped_refptr(T* t) {
371 return scoped_refptr<T>(t);
377 bool operator==(const scoped_refptr<T>& lhs, const U* rhs) {
382 bool operator==(const T* lhs, const scoped_refptr<U>& rhs) {
387 bool operator!=(const scoped_refptr<T>& lhs, const U* rhs) {
392 bool operator!=(const T* lhs, const scoped_refptr<U>& rhs) {
397 std::ostream& operator<<(std::ostream& out, const scoped_refptr<T>& p) {