Answer the question
In order to leave comments, you need to log in
Which stl container is best suited for this task?
Hello. The task is extremely simple: there is a certain image buffer (opencv Mat, CV_8UC3, 1920x1080). It is necessary in real time to add an element from one side, then take an element from the other side, use it and then remove it from the buffer. The buffer length can change during execution (but not often).
Now I'm using std::list. push_front to add to the beginning, back to get the last element, pop_back to remove it from the list. How effective is my choice, is there a container that is better suited for this task?
Answer the question
In order to leave comments, you need to log in
You have a description of the classic queue. Try queue
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question