This data structure uses a backing cpp::array object and supports a
vector like push_back API. In comparison with a traditional vector
data structure, it is of a fixed capacity and cannot be resized.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/__support/arraystore.h | ||
---|---|---|
15 | Currently, there is no way to add or remove elements that aren't at the end of the array. I would say either add operator[] or rename this to ArrayStack. |
libc/src/__support/arraystore.h | ||
---|---|---|
15 |
What do you mean "at the end of the array"? This data structure is not to be used like an array. It's internal storage uses an array.
We normally add methods as required. There is no requirement for operator[] so it isn't present. Its not clear to me how the presence or absence of that method should affect the name. I am open to a better name though. The name ArrayStore was chosen in the same pattern as that of the current cpp::BlockStore. Some other languages have similar concepts named FixedVector. I can change the name to that if it sounds better. |
I am going to submit this now in order to make progress with other things. Feel free to add comments and I will address them post commit.
Currently, there is no way to add or remove elements that aren't at the end of the array. I would say either add operator[] or rename this to ArrayStack.