Fixing of AutoBuffer::allocate(nsz) method
AutoBuffer::allocate(nsz) didn't work properly when (sz < nsz < fixed_size). In this case sz remained unchanged.
This commit is contained in:
@@ -817,10 +817,10 @@ AutoBuffer<_Tp, fixed_size>::allocate(size_t _size)
|
||||
return;
|
||||
}
|
||||
deallocate();
|
||||
sz = _size;
|
||||
if(_size > fixed_size)
|
||||
{
|
||||
ptr = new _Tp[_size];
|
||||
sz = _size;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user