(In reply to comment #2)
> (From update of attachment 49079[details])
> LGTM.
>
> My only concern is if "Type" could end up getting used for a stack object. We
> only use PassOwnPtr to return or pass values, never as a stack object or an
> instance variable.
[snip]
Looking at the auto_ptr and PassOwnPtr implementation, there is no constructor for stack allocated object. The constructor takes a pointer type:
template <typename T> class PassOwnPtr {
typedef typename RemovePointer<T>::Type ValueType;
typedef ValueType* PtrType;
PassOwnPtr(PtrType ptr = 0) : m_ptr(ptr) { }
}
So unless I miss something, using a stack object will be detected at compile time.
Thanks for the review!