title: Allocating array of objects inside another class (C++)
body: <p>How can I allocate an array of object inside another class in it's constructor?</p>
  
  <pre><code>class BloomFilter
  {
  public:
      BloomFilter(double fp, size_t capacity);
  private:
      size_t bf_m;
      size_t bf_k;
  };
  
  class RSig {
  public:
      RSig(int32_t sizeL1, int32_t sizeL2, double bfFpRate) :
          numSlot_sig(sizeL1), numSlot_bf(sizeL2)
      {
          TL_sigMem = new BloomFilter(bfFpRate, numSlot_bf)[sizeL1];
      }
  
  private:
      int32_t numSlot_sig, numSlot_bf;
      BloomFilter* TL_sigMem;
  };
  </code></pre>
  
  <p>The code above gives me the following error:</p>
  
  <pre><code>In constructor 'RSig::RSig(int32_t, int32_t, double)’:
  error: expected ‘;’ before ‘[’ token
           TL_sigMem = new TL_sigMem(bfFpRate, numSlot_bf)[sizeL1];
  </code></pre>
  
  <p>Preferably, I don't want to use <code>std::vector</code>. </p>