fix for DeallocatingVector::back

This method actually returned a reference to the one-past-the-last
element instead of the last element.
This commit is contained in:
Moritz Seemann 2017-01-11 16:42:52 +01:00
parent a2a2cf84d1
commit f896aaf881

View File

@ -356,8 +356,8 @@ class DeallocatingVector
ElementT &back() const
{
const std::size_t _bucket = current_size / ELEMENTS_PER_BLOCK;
const std::size_t _index = current_size % ELEMENTS_PER_BLOCK;
const std::size_t _bucket = (current_size - 1) / ELEMENTS_PER_BLOCK;
const std::size_t _index = (current_size - 1) % ELEMENTS_PER_BLOCK;
return (bucket_list[_bucket][_index]);
}