Use unique_ptr and appropriate container to do memory management
<p>First of all, my motivation is to do efficient memory management on top of a C like computational kernel. And I tried to use the <code>std::unique_ptr</code> and <code>std::vector</code>, my code looks like below</p>

<pre><code>// my data container
typedef std::unique_ptr&lt;double&gt; my_type;
std::vector&lt;my_type&gt; my_storage;

// when I need some memory for computation kernel
my_storage.push_back(my_type());
my_storage.back.reset(new double[some_length]);

// get pointer to do computational stuff
double *p_data=my_storage.back.get();
</code></pre>

<p>Notice here in practice <strong><code>p_data</code></strong> may be stored in some other container(e.g. map) to indexing each allocated array according to the domain problem, nevertheless, my main questions are</p>

<ol>
<li><p>Here is <code>std::vector</code> a good choice? what about other container like <code>std::list</code>/<code>set</code>?</p></li>
<li><p>Is there fundamental problem with my allocation method?</p></li>
<li><p>Suppose after I use <strong><code>p_data</code></strong> for some operations, now I want to release the memory chunk pointed by the raw pointer <strong><code>p_data</code></strong>, what is the best practice here?</p></li>
</ol>