title: thrust erase with permutation iterator not working
body: <p>I have a device_vector A. I have a Map M. I want to erase the elements of A using Map M.
  I try the following way but it gives compilation error "no instance of overloaded function..."</p>
  
  <pre><code>#include &lt;thrust/sequence.h&gt;
  #include &lt;thrust/execution_policy.h&gt;
  #include &lt;thrust/iterator/permutation_iterator.h&gt;
  #include &lt;thrust/fill.h&gt;
  
  void erase_value_using_map( thrust::device_vector&lt;int&gt;&amp; A, thrust::device_vector&lt;int&gt; Map)
  {
  
  A.erase(thrust::make_permutation_iterator(A.begin(), Map.begin()),
          thrust::make_permutation_iterator(A.begin(), Map.end()));
  
  }
  
  int main(int argc, char * argv[])
  {
  thrust::device_vector&lt;int&gt; A(20);
  thrust::sequence(thrust::device, A.begin(), A.end(),0);  // x components of the 'A' vectors
  
  thrust::device_vector&lt;int&gt; Map(10);
  Map[0]=2;Map[1]=4;Map[2]=8;Map[3]=10;Map[4]=11;Map[5]=13;Map[6]=15;Map[7]=17;Map[8]=19;Map[9]=6;
  
  erase_value_using_map(A, Map);
  
  return 0;
  }
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>error: no instance of overloaded function "thrust::device_vector&lt;T, Alloc&gt;::erase [with T=int, Alloc=thrust::device_malloc_allocator&lt;int&gt;]" matches the argument list
              argument types are: (thrust::permutation_iterator&lt;thrust::detail::normal_iterator&lt;thrust::device_ptr&lt;int&gt;&gt;, thrust::detail::normal_iterator&lt;thrust::device_ptr&lt;int&gt;&gt;&gt;, thrust::permutation_iterator&lt;thrust::detail::normal_iterator&lt;thrust::device_ptr&lt;int&gt;&gt;, thrust::detail::normal_iterator&lt;thrust::device_ptr&lt;int&gt;&gt;&gt;)
              object type is: thrust::device_vector&lt;int, thrust::device_malloc_allocator&lt;int&gt;&gt;
  </code></pre>