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

mystl vector pop_back should add return #2

Open
milley opened this issue Aug 21, 2020 · 0 comments
Open

mystl vector pop_back should add return #2

milley opened this issue Aug 21, 2020 · 0 comments

Comments

@milley
Copy link

milley commented Aug 21, 2020

Hi,
The method pop_back of mystl vector missing return, so i think u should add like this:

void pop_back() 
{
    if (!empty())
    {
        alloc_.destroy(--free_);                        
        return;
    }
    throw std::length_error("vector::pop_back() - the vector is empty"); 
}
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