[Glacier] Cleanup formatting for Array and Vector.
This commit is contained in:
parent
1c7eacd977
commit
569945f06d
3 changed files with 90 additions and 83 deletions
|
|
@ -8,16 +8,21 @@ template <typename T>
|
|||
class ArrayView {
|
||||
public:
|
||||
ArrayView() : data_(nullptr), size_(0) {}
|
||||
|
||||
ArrayView(const ArrayView&) = default;
|
||||
ArrayView(ArrayView&&) = default;
|
||||
|
||||
ArrayView(T* data, uint64_t size) : data_(data), size_(size) {}
|
||||
|
||||
// Accessors.
|
||||
T& operator[](uint64_t index) { return data_[index]; }
|
||||
const T& operator[](uint64_t index) const { return data_[index]; }
|
||||
|
||||
T* RawPtr() { return data_; }
|
||||
const T* RawPtr() const { return data_; }
|
||||
|
||||
uint64_t size() const { return size_; }
|
||||
|
||||
T& operator[](uint64_t index) { return data_[index]; }
|
||||
const T& operator[](uint64_t index) const { return data_[index]; }
|
||||
bool empty() const { return size_; }
|
||||
|
||||
private:
|
||||
T* data_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue