title: changing std::array to std::vector
body: <p>I have some code that uses a std::array. This is using the stack to allocate the memory. But I need to create an array of around 2MB. So doing some searching it seems that I can use std::vector that uses the heap.</p>
  <p>I modified my code to do that</p>
  <pre><code>//alignas(128) std::array&lt;uint32_t, array_size&gt; write_data;
  //alignas(128) std::array&lt;uint32_t, array_size&gt; read_data = { { 0 } };
  
  alignas(128) std::vector&lt;uint32_t&gt; write_data[array_size];
  alignas(128) std::vector&lt;uint32_t&gt; read_data[array_size];
  </code></pre>
  <p>But I am now getting error on other parts of the code. This uses some threads</p>
  <pre><code>  std::thread read_thread(read, std::ref(dev),
              (void*)read_data.data(), read_data.size() * sizeof(uint32_t), dma_block_size*32);
    std::thread write_thread(write, std::ref(dev),
              (void*)write_data.data(), write_data.size() * sizeof(uint32_t), num_dma_blocks);
  </code></pre>
  <p>E0289   no instance of constructor &quot;std::thread::thread&quot; matches the argument list<br />
  E0153   expression must have class type</p>
  <p>The problem is on the read/write and read_data/write_data in the code above. Could someone tell me what the issue is as I am not really a cpp programmer. Thanks</p>