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:
parent
a2a2cf84d1
commit
f896aaf881
@ -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]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user