From e6c3a80b01ffb52079783cddd9be6d392d0f7039 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 29 Jul 2024 19:59:52 -0400 Subject: redesign compositor protocol, start widget library --- euler/include/std/vector.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'euler/include/std/vector.hpp') 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; } + }; } -- cgit v1.2.3