diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-29 19:59:52 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-29 19:59:52 -0400 |
commit | e6c3a80b01ffb52079783cddd9be6d392d0f7039 (patch) | |
tree | 148276b9878f287bc81638f90249ec4d7b86eaf0 /euler/include/std/vector.hpp | |
parent | be691582ee12613278af24cb5a824eeb357f6324 (diff) | |
download | hilbert-os-e6c3a80b01ffb52079783cddd9be6d392d0f7039.tar.gz |
redesign compositor protocol, start widget library
Diffstat (limited to 'euler/include/std/vector.hpp')
-rw-r--r-- | euler/include/std/vector.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/euler/include/std/vector.hpp b/euler/include/std/vector.hpp index 1c35d9d..8cd02b4 100644 --- a/euler/include/std/vector.hpp +++ b/euler/include/std/vector.hpp @@ -131,6 +131,12 @@ namespace std { } + void clear() { + for (size_type i = 0; i < _size; ++i) + std::destroy_at(_data + i); + _size = 0; + } + constexpr size_type size() const noexcept { return _size; } @@ -188,6 +194,18 @@ namespace std { ++_size; } + using iterator = T *; + using const_iterator = const T *; + + iterator begin() noexcept { return _data; } + iterator end() noexcept { return _data + _size; } + + const_iterator begin() const noexcept { return _data; } + const_iterator end() const noexcept { return _data + _size; } + + const_iterator cbegin() const noexcept { return _data; } + const_iterator cend() const noexcept { return _data + _size; } + }; } |