How to insert and remove elements in a Thrust vector?


I started using Thrust library and I would like to know if there is a way of deleting an element in a specified position of the vector without the need of rearranging manually the vector. I usually use: name_of_vector.erase (name_of_vector.begin()+i); in STL vector, but I am not aware of a similar function in Thrust library. 

The same thing happens with inserting an element in a specified position without the need of manually shifting the elements after the inserted element. Usually I use name_of_vector.insert(name_of_vector.begin()+i,value); in STL vector.

If these functions do not exist in Thrust vectors, what is the most efficient way of performing these operations?

Thank you .

Those methods work with thrust vectors also.

Thank you txbob,

  I tested and they really work. I could not find them in the Thrust documentation so I assumed that they do not work, but they do.