title: CUDA Thrust return type
body: <p>I am currently trying to use the Thrust library and I am having issues with the return types.</p>
  
  <pre><code>  device_vector&lt;int&gt; input(5);
  
    input[0] = 0;
    input[1] = 2;
    input[2] = 5;
    input[3] = 7;
    input[4] = 8;
  
    pair&lt;int*, int*&gt; result= minmax_element(input.begin(), input.end());
  </code></pre>
  
  <p>gives the error:</p>
  
  <pre><code> error : no suitable conversion function from "const thrust::detail::normal_iterator&lt;thrust::device_ptr&lt;int&gt;&gt;" to "int *" exists
  </code></pre>
  
  <p>Could someone please explain to me how work out what the return type should be?</p>
  
  <p>according to the <a href="http://thrust.googlecode.com/svn/tags/1.1.0/doc/html/group__extrema.html" rel="nofollow">documentation</a> the return type is </p>
  
  <pre><code>thrust::pair&lt;ForwardIterator,ForwardIterator&gt;
  </code></pre>
  
  <p>However this not not working for me, could someone please explain!</p>
  
  <p>Thanks!</p>