Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unique_ptr::release() has wrong type #11

Open
kamahen opened this issue Jun 11, 2024 · 0 comments
Open

unique_ptr::release() has wrong type #11

kamahen opened this issue Jun 11, 2024 · 0 comments

Comments

@kamahen
Copy link

kamahen commented Jun 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant