rewrote end() for StaticVector

This commit is contained in:
froejdh_e
2025-05-21 15:46:04 +02:00
parent d739453f2b
commit 3619a032ac
2 changed files with 32 additions and 23 deletions

View File

@ -113,10 +113,10 @@ template <typename T, size_t Capacity> class StaticVector {
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();
// }
const_iterator begin() const noexcept { return data_.begin(); }
iterator end() noexcept { return &data_[current_size]; }
const_iterator end() const noexcept { return &data_[current_size]; }
iterator end() noexcept { return data_.begin()+current_size; }
const_iterator end() const noexcept { return data_.begin()+current_size; }
const_iterator cbegin() const noexcept { return data_.cbegin(); }
const_iterator cend() const noexcept { return &data_[current_size]; }
const_iterator cend() const noexcept { return data_.cbegin()+current_size; }
void size_check(size_type s) const {
if (s > Capacity) {