title: Static arrays VS. dynamic arrays in C++11
body: <p>I know that it's a very old debate that has already been discussed many times all over the world. But I'm currently having troubles deciding which method I should use rather than another between static and dynamic arrays in a particular case. Actually, I woudn't have used C++11, I would have used static arrays. But I'm now confused since there could be equivalent benefits with both.</p>
  
  <p>First solution:</p>
  
  <pre><code>template&lt;size_t N&gt;
  class Foo
  {
      private:
          int array[N];
  
      public:
          // Some functions
  }
  </code></pre>
  
  <p>Second solution:</p>
  
  <pre><code>template&lt;size_t N&gt;
  class Foo
  {
      private:
          int* array;
  
      public:
          // Some functions
  }
  </code></pre>
  
  <p>I can't happen to chose since the two have their own advantages:</p>
  
  <ul>
  <li>Static arrays are faster, and we don't care about memory managment at all.</li>
  <li>Dynamic arrays do not weigth anything as long as memory is not allocated. After that, they are less handy to use than static arrays. But since C++11, we can have great benefits from move semantics, which we can not use with static arrays.</li>
  </ul>
  
  <p>I don't think there is one good solution, but I would like to get some advice or just to know what you think of all that.</p>