title: C++ wrapper for an array of pointers returned from a C function
body: <p>I'm adding a C++ front-end to a C library.  One function in this library calls back to a handler with an array and an integer with the size of the array.  Therefore you must provide a C function,</p>
  
  <pre><code>int handler(int argc, sometype **argv);
  </code></pre>
  
  <p>Now, I'd like to allow the C++ calling code to provide a more C++ish handler function, something like,</p>
  
  <pre><code>int handler(std::vector&lt;sometype*&gt; args);
  </code></pre>
  
  <p>Changing the handler type isn't hard, I just have to provide my own <code>handler</code> which then calls the user-provided handler.  So I need to create an <code>std::vector</code> and copy the contents of <code>argv</code> into it.</p>
  
  <p>However, I don't really want to copy the entire list of pointers if possible.  Unfortunately I think it's not possible to tell <code>std::vector</code> to use an already-allocated block of memory for its internal array, and moreover the array is static, and should be considered <code>const</code>.</p>
  
  <p>Is there some STL type similar to <code>std::vector</code> that can be used to wrap pre-allocated C-style arrays with a more friendly interface?  It should support size query and iteration, similar to <code>std::vector</code>.</p>
  
  <p>Thanks.</p>