I would like to know if the following code is thread-safe
void use_value(int i, unique_ptr<vector<int>> v);
for (int i = 0; i < 10; i++){
unique_ptr<vector<int>> ptr = make_unique<vector<int>>(10);
// ...
// Here, the vector pointed to by ptr will be filled with specific values for each thread.
// ....
thread(
[i, &ptr](){
use_value(i, move(ptr));
}
);
}
Thank you