I'd like to have a static (const) vector in a static class. The vector wont be filled with new elements, it will only have the elements defined in class configuration
: {1,2,3,4,5}
.
How can I make the vector debugLevels
static?
#include <ArduinoSTL.h>
class configuration {
public:
static std::vector<int> const debugLevels = {1,2,3,4,5}; // throws error: in-class initialization of static data member 'const std::vector<int> configuration::debugLevels' of incomplete type
};
void setup() {
for(int i=0; i<configuration::debugLevels.size(); i++ {
// do some stuff here...
}
}
void loop() {
}