title: Suppressing warning: comparison is always false due to limited scope of data type
body: <p>I have a templated function for returning the number of digits in a number:</p>
  
  <pre><code>    template &lt;typename R&gt;
      static inline unsigned count(const R num)
      {
          if(num &lt; 10)                    return 1;
          else if (num &lt; 100)             return 2;
          else if (num &lt; 1000)            return 3;
          else if (num &lt; 10000)           return 4;
          else if (num &lt; 100000)          return 5;
          else if (num &lt; 1000000)         return 6;
          else if (num &lt; 10000000)        return 7;
          else if (num &lt; 100000000)       return 8;
          else if (num &lt; 1000000000)      return 9;
          else if (num &lt; 10000000000ULL)          return 10;
          else if (num &lt; 100000000000ULL)         return 11;
          else if (num &lt; 1000000000000ULL)        return 12;
          else if (num &lt; 10000000000000ULL)       return 13;
          else if (num &lt; 100000000000000ULL)      return 14;
          else if (num &lt; 1000000000000000ULL)     return 15;
          else if (num &lt; 10000000000000000ULL)    return 16;
          else if (num &lt; 100000000000000000ULL)   return 17;
          else if (num &lt; 1000000000000000000ULL)  return 18;
          else if (num &lt; 10000000000000000000ULL) return 19;
          else                                    return 20;
      }
  </code></pre>
  
  <p>However when I compile (GCC) I get the following warning:</p>
  
  <pre><code>warning: comparison is always true due to limited range of data type
  </code></pre>
  
  <p>I understand why I get this repeatedly but I'm not sure how to suppress/avoid it.</p>
  
  <p>Any thoughts?</p>