title: How to resize the device_vector after I use the unique_by_key?
body: <p>This is the code I used.
  But it can not work.
  something wrong with the new_end;</p>
  
  <pre><code>thrust::device_vector&lt;int&gt; keys;
  thrust::device_vector&lt;int&gt; values;
  // after initialization.
  
  pair&lt;int*, int*&gt; new_end;
  new_end = thrust::unique_by_key(keys.begin(), keys.end(), values.begin());
  keys.resize(thrust::distance(keys.begin,new_end.first));
  values.resize(thrust::distance(values.begin(), new_end.right));
  </code></pre>