Skip to content

unique_ptr::release() has wrong type #11

Description

@kamahen

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions