unique_ptr::release() should be something like this:
inline T* release() throw()
{
T* get_px = px;
px = nullptr;
return get_px;
}
googletest/googletest/include/gtest/internal/gtest-port.h gets this right.
Also, there's no test case for release().
(There's also a private release() const, whose comment I don't understand; presumably it should also return the value? But it doesn't seem to be used anywhere.)
unique_ptr::release()should be something like this:googletest/googletest/include/gtest/internal/gtest-port.hgets this right.Also, there's no test case for
release().(There's also a private
release() const, whose comment I don't understand; presumably it should also return the value? But it doesn't seem to be used anywhere.)