util/AllocatedArray: use WritableBuffer::operator[]
This commit is contained in:
parent
561ccf600f
commit
908b6a1939
|
@ -30,6 +30,7 @@
|
||||||
#ifndef ALLOCATED_ARRAY_HXX
|
#ifndef ALLOCATED_ARRAY_HXX
|
||||||
#define ALLOCATED_ARRAY_HXX
|
#define ALLOCATED_ARRAY_HXX
|
||||||
|
|
||||||
|
#include "ConstBuffer.hxx"
|
||||||
#include "WritableBuffer.hxx"
|
#include "WritableBuffer.hxx"
|
||||||
#include "Compiler.h"
|
#include "Compiler.h"
|
||||||
|
|
||||||
|
@ -148,18 +149,14 @@ public:
|
||||||
* Returns one element. No bounds checking.
|
* Returns one element. No bounds checking.
|
||||||
*/
|
*/
|
||||||
reference_type operator[](size_type i) noexcept {
|
reference_type operator[](size_type i) noexcept {
|
||||||
assert(i < size());
|
return buffer[i];
|
||||||
|
|
||||||
return buffer.data[i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns one constant element. No bounds checking.
|
* Returns one constant element. No bounds checking.
|
||||||
*/
|
*/
|
||||||
const_reference_type operator[](size_type i) const noexcept {
|
const_reference_type operator[](size_type i) const noexcept {
|
||||||
assert(i < size());
|
return buffer[i];
|
||||||
|
|
||||||
return buffer.data[i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator begin() noexcept {
|
iterator begin() noexcept {
|
||||||
|
|
Loading…
Reference in New Issue