deleting element (objects) within a vector (not referenced by pointer) , memory handling
<p>This is an extension of <a href="http://stackoverflow.com/questions/2228492/vector-declaration-and-size-allocation">this question</a> . I have searched on the web but couldn't find a satisfactory answer. </p>

<p>I have a <code>class A</code> which defines a vector that contains a number of instances of <code>class Region</code>.  The memory handling for these <code>Region</code> instances need to be managed by <code>Class A</code></p>

<p>My questions are:</p>

<p><strong>1.</strong> In the following code snippet, do I need to explicitly delete these instances in the desctuctor of class A? </p>

<p><strong>2.</strong> Should I create instances as <code>new Region(i)</code> ?  Is it better over the first option (not using <code>new</code>) Class A is quite a large object. How should I determine whether to use new or not? </p>

<p><strong>3.</strong> If Answer to #2 is yes, how should I delete these instances in the destructor ? <code>delete Region(i)</code> (in a for loop)  or  <code>delete [] reg</code>??  I am guessing former way is the correct way, but want to confirm. </p>

<p><strong>4.</strong> Other than "Region instances are not deleted" , do you see any obvious memory leak... especially in the construction of Region object in <code>A</code>'s constructor?</p>

<pre><code>class Region{
   public:
      Region(int num);
      int number;
      std::vector &lt;elemt*&gt; elements;   
      int info;
}

class A{
public:
    std::vector&lt;Region&gt; reg;
    const int numOfRegions = 100;
}

A::A(){
    int i;
    for ( i=0; i&lt;numOfRegions; i++){
        reg.push_back(Region(i));
      } 
}

A::~A(){
  // How should the elements within vector Region be deleted??
  // Should I use "new" to allocate memory to instances of Region()
}
</code></pre>

<p><strong>UPDATE:</strong>
A BIG Thanks to all who answered! </p>
