mike-matera/ArduinoSTL

Accessing Inner pointer for std::vector

Closed this issue · 0 comments

I recently installed the library hoping it would aid my implementation.

What I basically do is I try to access the inner pointer to the data held by std::vector, like in the standard std::vector implementation using vector::data() function. This gives me a ton of errors because I think this functionality is not implemented.

Later edit: What I am trying to do is copy some memory held in a regular C buffer inside of the vector:

std::vector<uint8_t> buffer(10);

// some C buffer here holding some data called let's say buf
// copy it in the vector
memcpy(buffer.data(), buf, 10 * sizeof(uint8_t))

Could this be achieved using ArduinoSTL?

Later, later edit: Just realised that the begin() function does exactly what I am looking for.