#include <nsCOMPtr.h>
Collaboration diagram for already_AddRefed< T >:Public Member Functions | |
| already_AddRefed (T *aRawPtr) | |
| T * | get () const |
| template<class U > | |
| operator already_AddRefed< U > () | |
| This helper is useful in cases like. | |
Public Attributes | |
| T * | mRawPtr |
| already_AddRefed< T >::already_AddRefed | ( | T * | aRawPtr | ) | [inline] |
| T* already_AddRefed< T >::get | ( | ) | const [inline] |
| already_AddRefed< T >::operator already_AddRefed< U > | ( | ) | [inline] |
This helper is useful in cases like.
already_AddRefed<BaseClass> Foo() { nsRefPtr<SubClass> x = ...; return x.forget(); }
The autoconversion allows one to omit the idiom
nsRefPtr<BaseClass> y = x.forget(); return y.forget();
| T* already_AddRefed< T >::mRawPtr |
1.7.1