title: Thread-safety of using unique_ptr inside lambda when creating new thread
body: <p>I would like to know if the following code is thread-safe</p>
  
  <pre><code>void use_value(int i, unique_ptr&lt;vector&lt;int&gt;&gt; v);
  for (int i = 0; i &lt; 10; i++){
      unique_ptr&lt;vector&lt;int&gt;&gt; ptr = make_unique&lt;vector&lt;int&gt;&gt;(10);
      // ...
      // Here, the vector pointed to by ptr will be filled with specific values for each thread.
      // ....
      thread(
          [i, &amp;ptr](){
              use_value(i, move(ptr));
          }
      );
  }
  </code></pre>
  
  <p>Thank you</p>