File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -29,21 +29,24 @@ template <typename T, size_t CAPACITY> class FixedVector {
2929 using iterator = typename cpp::array<T, CAPACITY>::iterator;
3030 LIBC_INLINE constexpr FixedVector (iterator begin, iterator end)
3131 : store{}, item_count{} {
32+ LIBC_ASSERT (begin + CAPACITY >= end);
3233 for (; begin != end; ++begin)
33- LIBC_ASSERT ( push_back (*begin) );
34+ push_back (*begin);
3435 }
3536
3637 using const_iterator = typename cpp::array<T, CAPACITY>::const_iterator;
3738 LIBC_INLINE constexpr FixedVector (const_iterator begin, const_iterator end)
3839 : store{}, item_count{} {
40+ LIBC_ASSERT (begin + CAPACITY >= end);
3941 for (; begin != end; ++begin)
40- LIBC_ASSERT ( push_back (*begin) );
42+ push_back (*begin);
4143 }
4244
4345 LIBC_INLINE constexpr FixedVector (size_t count, const T &value)
4446 : store{}, item_count{} {
47+ LIBC_ASSERT (count <= CAPACITY);
4548 for (size_t i = 0 ; i < count; ++i)
46- LIBC_ASSERT ( push_back (value) );
49+ push_back (value);
4750 }
4851
4952 LIBC_INLINE constexpr bool push_back (const T &obj) {
You can’t perform that action at this time.
0 commit comments