I was reading this page:
http://cpp-tip-of-the-day.blogspot.com.br/2013/11/how-is-stddeque-implemented.html
The problem is:
Ok, there is chunks of data which will be allocated according with the
necessity, for right or left.
However, How can the mapping of the chunks be implemented?
If the mapping is implemented as a vector of pointer to allocated data
(with fixed size), so there will be shifts when a new chunk is
push_front-created, for example.
Example:
[0x100, 0x200, 0x300] is the mapping (three chunks)
now a new chunk (pointer to 0x400 for example) is allocated and added to
beginning of chunks.
[0x400, 0x100, 0x200, 0x300]
You can notice that the three address were shifted when this behavior (I
think) is not the desired.
So, how could the mapping to chunks be implemented?