Merge pull request #548 from ChaiScript/stack-vector-pop-back

Fix stack_vector.pop_back() pre-decrementing
This commit is contained in:
Rob Loach 2021-01-07 15:55:48 -05:00 committed by GitHub
commit cb55083603
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>) { 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>) ~Stack_Vector() noexcept(std::is_nothrow_destructible_v<T>)