c - If a Thrust device_vector's .begin() iterator is stored, does it still point to the correct position after a resize()? -


this question has answer here:

for instance:

thrust::device_vector<float> vec(...); thrust::device_vector<float>::iterator = vec.begin(); vec.resize(...);    // vec may reallocated , moved in memory here 

now, has vec.begin() updated , still point validly start of vec?

upon resizing, if vector did not have enough space, iterator invalidated, you'd have recall vec.begin() new, valid iterator.


Comments