11 #ifndef __STATIC_VECTOR_HEADER
12 #define __STATIC_VECTOR_HEADER
19 template<
typename T, u
int16_t capacity_>
41 ASSERT_MSG(size_ < capacity_,
"static_vector too small")
50 for(; pos < size_; ++pos) {
51 if(array_[pos] == val)
62 array_[
i] = array_[
i + 1];
76 return array_[size_ - 1];
80 return array_[size_ - 1];
96 uint8_t read_impl(
size_type const & adr, U
const & val) {
100 uint8_t read_impl(
size_type const & adr, uint8_t const & val) {
104 void write_impl(
size_type const & adr, U
const & val) {
107 void write_impl(
size_type const & adr, uint8_t
const & val) {
112 return read_impl(adr, T());
115 write_impl(adr, val);
122 ASSERT(new_size <= capacity_);
129 if(new_size > size_) {
130 while(new_size > size_) {
176 template<
typename Archive>
187 #endif //__STATIC_VECTOR_HEADER
T * data()
just return the internal cpp-array
Definition: array.hpp:79
static_vector(size_type const &size, T const &val=T())
Definition: static_vector.hpp:27
void write(size_type const &adr, T const &val)
Definition: static_vector.hpp:114
void pop_back()
Definition: static_vector.hpp:45
void push_back(T const &in)
Definition: static_vector.hpp:40
T const & back() const
Definition: static_vector.hpp:78
void print(S &os) const
Definition: static_vector.hpp:167
T & back()
Definition: static_vector.hpp:74
uint16_t size_type
Definition: static_vector.hpp:23
size_type find(T const &val, size_type pos=0) const
Definition: static_vector.hpp:49
#define ASSERT_MSG(exp, msg)
Definition: ard_assert.hpp:34
uint8_t read(size_type const &adr)
Definition: static_vector.hpp:111
static_vector(static_vector const &arg)
Definition: static_vector.hpp:32
constexpr size_type capacity()
Definition: static_vector.hpp:125
void set_size(size_type const &new_size)
Definition: static_vector.hpp:121
void resize(size_type const &new_size, T const &val=T())
Definition: static_vector.hpp:128
T const & front() const
Definition: static_vector.hpp:86
void erase(size_type const &pos)
Definition: static_vector.hpp:59
T value_type
Definition: static_vector.hpp:22
T const & operator[](size_type const &pos) const
Definition: static_vector.hpp:71
bool empty() const
Definition: static_vector.hpp:139
T & front()
Definition: static_vector.hpp:82
void serialize(Archive &ar)
Definition: static_vector.hpp:177
T * data()
Definition: static_vector.hpp:90
static_vector & operator=(static_vector const &rhs)
Definition: static_vector.hpp:34
#define F(x)
Definition: ustd_generic.hpp:15
T & operator[](size_type const &pos)
Definition: static_vector.hpp:68
size_type const & size() const
Definition: static_vector.hpp:118
Definition: static_vector.hpp:20
static_vector()
Definition: static_vector.hpp:25
#define ASSERT(exp)
Definition: ard_assert.hpp:33
void clear()
Definition: static_vector.hpp:56