MiiNiPaa:
Thank you very much for your answer!
You teach me a lot!
I tested deque it worked! It didn't move the block!
I was very excited about deque!
Until I read:
deques are not guaranteed to store all its elements in contiguous storage locations: accessing elements in a deque by offsetting a pointer to another element causes undefined behavior. |
http://www.cplusplus.com/reference/deque/deque/
One of the restrictions of our code, is that it requires to have all objects, (on this case colors) sequentially aligned.
I confess you something: Our proposal, which I wish you can open one day, isn't really our proposal. It was an idea, I started to post this idea here on this forum and obtained a lot of feedback and ideas that made my idea to have enough arguments to be a proposal. This proposal is possible thanks to all of your answers, comments and feedback. I think that we've already researched enough to conclude that it is necessary for some cases.
There are other cases where
vector and
deque are the best option, that's why they exist. I've also used them or similiar implementations (like hashSet, HashMap, etc. in Java) for other applications, but for heuristics, where the main goal is to optimize the code to its best performance, this improvement for the
delete[size]
operator is required to allow the freeing of data after it was computed.
Thanks to your last answer I'll update a little our draft and improve it. It is really the result of all your feedback.
I want to thank all of you with a page, where we mention the username of each of you. It will require some time and for now it is on the queue, but I want to personally thank you
MiiNiPaa, for your knowledge, your time, your patience and your help, all together contributes a lot for our project, what at the end should contribute for the benefit of all of us.