mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-17 02:17:02 +00:00
@@ -23,10 +23,12 @@ public:
|
||||
++this->current;
|
||||
return *this;
|
||||
}
|
||||
const_pointer_iterator& operator++(int) { return const_pointer_iterator(this->current++); }
|
||||
const_pointer_iterator& operator--() {
|
||||
--this->current;
|
||||
return *this;
|
||||
}
|
||||
const_pointer_iterator& operator--(int) { return const_pointer_iterator(this->current--); }
|
||||
const_pointer_iterator& operator+=(int v) {
|
||||
this->current += v;
|
||||
return *this;
|
||||
@@ -65,19 +67,17 @@ public:
|
||||
void operator=(const T& other) { rstl::construct(this->current, other); }
|
||||
T& operator*() { return *this->current; }
|
||||
T* operator->() { return this->current; }
|
||||
void destroy() const {
|
||||
if (this->current != nullptr) {
|
||||
rstl::destroy(this->current);
|
||||
}
|
||||
}
|
||||
void destroy() const { rstl::destroy(this->current); }
|
||||
pointer_iterator& operator++() {
|
||||
++this->current;
|
||||
return *this;
|
||||
}
|
||||
pointer_iterator operator++(int) { return pointer_iterator(this->current++); }
|
||||
pointer_iterator& operator--() {
|
||||
--this->current;
|
||||
return *this;
|
||||
}
|
||||
pointer_iterator operator--(int) { return pointer_iterator(this->current--); }
|
||||
pointer_iterator& operator+=(int v) {
|
||||
this->current += v;
|
||||
return *this;
|
||||
@@ -86,12 +86,8 @@ public:
|
||||
this->current -= v;
|
||||
return *this;
|
||||
}
|
||||
pointer_iterator operator+(int v) const {
|
||||
return pointer_iterator(this->current + v);
|
||||
}
|
||||
pointer_iterator operator-(int v) const {
|
||||
return pointer_iterator(this->current - v);
|
||||
}
|
||||
pointer_iterator operator+(int v) const { return pointer_iterator(this->current + v); }
|
||||
pointer_iterator operator-(int v) const { return pointer_iterator(this->current - v); }
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ struct rmemory_allocator {
|
||||
template < typename T >
|
||||
static void deallocate(T* ptr) {
|
||||
if (ptr != nullptr)
|
||||
delete ptr;
|
||||
CMemory::Free(ptr);
|
||||
}
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
@@ -98,11 +98,14 @@ public:
|
||||
inline T* data() { return xc_items; }
|
||||
inline const T* data() const { return xc_items; }
|
||||
inline int size() const { return x4_count; }
|
||||
inline bool empty() const { return x4_count == 0; }
|
||||
inline int capacity() const { return x8_capacity; }
|
||||
inline T& front() { return xc_items[0]; }
|
||||
inline const T& front() const { return xc_items[0]; }
|
||||
inline T& back() { return xc_items[x4_count - 1]; }
|
||||
inline const T& back() const { return xc_items[x4_count - 1]; }
|
||||
inline T& at(int idx) { return xc_items[idx]; }
|
||||
inline const T& at(int idx) const { return xc_items[idx]; }
|
||||
inline T& front() { return at(0); }
|
||||
inline const T& front() const { return at(0); }
|
||||
inline T& back() { return at(x4_count - 1); }
|
||||
inline const T& back() const { return at(x4_count - 1); }
|
||||
inline T& operator[](int idx) { return xc_items[idx]; }
|
||||
inline const T& operator[](int idx) const { return xc_items[idx]; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user