Fix stack_vector.pop_back() pre-decrementing

Fixes #547, found by @balint-luko.
This commit is contained in:
Rob Loach 2021-01-07 13:15:47 -05:00 committed by GitHub
parent d7832661e7
commit c7fcc9f7d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ struct Stack_Vector
};
void pop_back() noexcept(std::is_nothrow_destructible_v<T>) {
(*this)[m_size--].~T();
(*this)[--m_size].~T();
}
~Stack_Vector() noexcept(std::is_nothrow_destructible_v<T>)