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

[Bugs report] `Vec::pop` is not exception safe #5

iosmanthus opened this issue Aug 5, 2019 · 0 comments


Copy link

commented Aug 5, 2019

The Vec::pop maybe fail while copying the object.

template <typename T>
std::optional<T> Vec<T>::pop()
if (this->len > 0)
return this->buf[this->len-- - 1];
return {};

@iosmanthus iosmanthus changed the title [Bugs report] [Bugs report] `Vec::pop` is not exception safe Aug 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.