Skip to content

ACSelect set element by index value #330

Answered by Hieromon
Koxx3 asked this question in Q&A
Discussion options

You must be logged in to vote

The substance of the element value of ACSelect is stored in the sequence container created by std::vector. Therefore, it cannot store the value by specifying an index that directly indexes the element value.
Also, the insertion of std::vector can be positioned using an iterator, but it is a relative position, not the absolute coordinates indicated by the so-called index.
(e.g. If the container has 1 elements currently and you try to insert it 3rd (as index), the result will be undefined. (which will probably cause a segfault)
Therefore, your requirement does not conform to the data structure of ACSelect.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Koxx3
Comment options

@Hieromon
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Hieromon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #324 on March 17, 2021 05:05.