c++ - stl vector assign vs insert -


I understand the words of 2 tasks, assigns before replacing the supply values, insert - value at the specified location Inserts (allocates new memory if necessary).

Is there any reason to preferring one over each other? Or to keep it in any other way, there is a reason to move rather than insert.

To apply the words of assign if you prefer, Assign call - If you want to call the semantics of insert , call a call is not interchangeable.

To call them on an empty vector, the only difference is that when you call , you do not need to give an iterator to enter it. . . There may be a performance difference in this, but this implementation is specific and almost certainly careless.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -