title: Are there any issues with allocating memory within constructor initialization lists?
body: <p>I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.</p>
  
  <p>So you can do something (as a contrived example) like this:</p>
  
  <pre><code>class Test
  {
  private:
      int* i;
      int* j;
      int count;
      int* k;
  
  public:
      Test(void) : i(new int), j(new int[10]), count(10), k(new int[count])
      {
      }
  
      ~Test(void)
      {
          delete i;
          delete [] j;
          delete [] k;
      }
  };
  </code></pre>
  
  <p>Are there any issues in doing memory allocation in this way? Regarding the order of initialization here is it safe to have a parameter initialized by one initialized in the same list? i.e. as I allocate <code>count</code> before I use it is it safe to use or is there some special initialization order I could fall foul of?</p>