a std::vector like class (dynamic array)

https://github.com/GPierre-Antoine/arduino_vector
This is a light implementation of vector class to use in arduino.

a quick readme explains how to use the class on github.

else, it is pag::vector<my_type> my_var = pag::vector<my_type>(/*size*/);

the main methods are :

  • operator (const and non const ref)
  • size(), indicating the number of item contained
  • resize (returns false if fails)
  • .begin() and .end(), to use like a light iterator system.
  • I made the choice not to use push_back and such, because I didn’t want to take responsibility for allocating to much resources automatically

Feel free to use and alter it, under the use licence of course (GPL).

I think it is risky to use any code that dynamically allocates memory in the small SRAM available on an Arduino.

...R

github link is dead