1

Topic: Unordered array

And in  there is generally a container which works as a vector, but at removal of an element does not shift the data, and simply remembers that here is empty, and the following insertion makes in this place of type as the list of a current without constant separation/removals of storage

2

Re: Unordered array

Hello, Kingofastellarwar, you wrote: K> and in  there is generally a container which works as a vector, but at removal of an element does not shift the data, and simply remembers that here is empty, and the following insertion makes in this place K> type as the list of a current without constant separation/removals of storage So the manager of storage does.

3

Re: Unordered array

Hello, Kingofastellarwar, you wrote: K> and in  there is generally a container which works as a vector, but at removal of an element does not shift the data, and simply remembers that here is empty, and the following insertion makes in this place Prominent feature of arrays (and a vector) storage of all elements continuously one after another in one memory block is. Holes in it cannot be. K> type as the list of a current without constant separation/removals of storage So the list or an array? If it would be desirable to do without constant separation of storage, fasten to it the .

4

Re: Unordered array

K> and in  there is generally a container which works as a vector, but at removal of an element does not shift the data, and simply remembers that here is empty, and the following insertion makes in this place K> type as the list of a current without constant separation/removals of storage It is possible to use the hash table.

5

Re: Unordered array

If the order not  that for speed it is possible to transfer the last element to the place of remote, and to delete the last

6

Re: Unordered array

Hello, Wawan, you wrote: W>... And to delete last  it is not necessary? Whether better simply to shift the end pointer?

7

Re: Unordered array

Hello, Kingofastellarwar, you wrote: K> and in  there is generally a container which works as a vector, but at removal of an element does not shift the data, and simply remembers that here is empty, and the following insertion makes in this place And what operations generally are required? index-access? Bypass of all live? K> type as the list of a current without constant separation/removals of storage of Stepans was told that by him such and wanted to make initial list, and further sets an example implementation list_pool - just some lists over one vector. It is possible to take normal std:: list, two are more exact - in one there will be live elements, and in the second empty/dead. When it is necessary new - you do std:: list:: splice for transfer of a node of one list in another. That there was no constant separation of storage (at shortage of empty nodes) - beforehand fill the list-donor with the necessary amount of empty elements. But the decision on basis vector' would be natural better. It is possible to take Boost. Pool - there inside  there is an implementation on basis +freelist - it can be combined with std:: list, or to use directly.

8

Re: Unordered array

Hello, Kodt, you wrote: >T& at (size_t i) {> assert (i <count);> return items [indices [i]];}> Not clearly what exactly is necessary for the HARDWARE - for in a subject "unordered", and probably means it is possible to do without road items [indices [i]]. Can to it the list under which pool of nodes in a vector is necessary simply, and the list can even is not necessary, and simply fast allocate/deallocate for fixed size.