title: How can I use decltype to get a pointer without a reference?
body: <p>I have a function:</p>
  
  <pre><code>auto get_values_at_indices(auto* array, Vector&lt;int&gt;* indices)
  {
      std::vector&lt;decltype(*array)&gt; ret(indices-&gt;size());
  
      for (int i = 0; i &lt; indices-&gt;size(); i ++)
      {
          int index = indices[i];
          ret.push_back(array[index]);
      }
  
      return ret;
  }
  </code></pre>
  
  <p>I'm calling the function with </p>
  
  <pre><code>MyClass** array = new MyClass[100];
  std::vector&lt;MyClass*&gt; subset = get_values_at_indices(array, indices);
  </code></pre>
  
  <p>But the compiler sees <code>decltype(*array)</code> as <code>MyClass*&amp;</code> (as opposed to <code>MyClass*</code>, which is what I want) - what should I try?</p>
  
  <p>(PS, I tried <code>std::vector&lt;decltype(&amp;(***array))&gt; ret(indices-&gt;size());</code> but no dice ;)</p>