
16 Apr
2010
16 Apr
'10
3:26 p.m.
What actually happens is something like this:
1 2 3 3 1 2 2 3 1 [A][B][C] -> push_back(D) -> [D][B][C] -> push_back(E) -> [D][E][C]
The indexes are adjusted, but the physical locations of the elements don't change.
In Christ, Steven Watanabe
Thanks Steven, But this is desired? In this way is difficult to work on indexes eg with operator[]. What I expect is that the value at index 0 is always at position Buffer[0] unless it will be replaced by another value... Suppose I have a producer that write to the buffer and some consumer that reads from it, each of them at different locations, this could be accomplish only with iterators? Regards, Daniele.