mirror of https://github.com/PentHertz/srsLTE.git
fix assertion messages for bounded_vector::back() method
This commit is contained in:
parent
5cce2e4dc7
commit
7ee99a529a
|
@ -101,8 +101,16 @@ public:
|
|||
assert(i < size_ && "Array index is out of bounds.");
|
||||
return reinterpret_cast<const T&>(buffer[i]);
|
||||
}
|
||||
T& back() { return (*this)[size_ - 1]; }
|
||||
const T& back() const { return (*this)[size_ - 1]; }
|
||||
T& back()
|
||||
{
|
||||
assert(size_ > 0 && "Trying to get back of empty array.");
|
||||
return *(begin() + size_ - 1);
|
||||
}
|
||||
const T& back() const
|
||||
{
|
||||
assert(size_ > 0 && "Trying to get back of empty array.");
|
||||
return *(begin() + size_ - 1);
|
||||
}
|
||||
T& front() { return (*this)[0]; }
|
||||
const T& front() const { return (*this)[0]; }
|
||||
T* data() { return reinterpret_cast<T*>(&buffer[0]); }
|
||||
|
|
Loading…
Reference in New Issue