ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You'd better use


or std::list with push_front() and pop_back()

The problem with std::vector in this use case is that it will have to relocate your entire data every time you call insert( name_vector.begin(),element) in order for keeping its memory layout. This might be computationally expensive! For std::vector you can only efficiently insert / remove objects at the end of the vector.