title: Function with a size_t Template Parameter
body: <p>I'm trying to understand the template function. The ultimate goal is to pass an entire array to a function. There seem to be many different ways to implement this but they all use the template function. Here's one of the simpler examples I've found...</p>
  
  <pre><code>template&lt;size_t N&gt;
  void h(Sample (&amp;arr)[N])
  {
      size_t count = N; //N is 10, so would be count!
      //you can even do this now:
      //size_t count = sizeof(arr)/sizeof(arr[0]);  it'll return 10!
  }
  Sample arr[10];
  h(arr); //pass : same as before!
  </code></pre>
  
  <p>I thought template&lt;> was used to create a variable that could be used in place of int, float, char, etc.. what's the point of specifying the type (size_t), what does this do?</p>