title: How can I specialize a C++ template for a range of integer values?
body: <p>Is there a way to have a template specialization based on a range of values instead of just one? I know the following code is not valid C++ code but it shows what I would like to do.  I'm writing code for a 8-bit machine, so there is a difference in speed for using ints and chars.</p>
  
  <pre><code>template&lt;unsigned SIZE&gt;
  class circular_buffer {
     unsigned char buffer[SIZE];
     unsigned int head; // index
     unsigned int tail; // index
  };
  
  template&lt;unsigned SIZE &lt;= 256&gt;
  class circular_buffer {
     unsigned char buffer[SIZE];
     unsigned char head; // index
     unsigned char tail; // index
  };
  </code></pre>