title: Use of 'const' for function parameters
body: <p>How far do you go with <code>const</code>?  Do you just make functions <code>const</code> when necessary or do you go the whole hog and use it everywhere?  For example, imagine a simple mutator that takes a single boolean parameter:</p>
  
  <pre><code>void SetValue(const bool b) { my_val_ = b; }
  </code></pre>
  
  <p>Is that <code>const</code> actually useful?  Personally I opt to use it extensively, including parameters, but in this case I wonder if it's worthwhile?</p>
  
  <p>I was also surprised to learn that you can omit <code>const</code> from parameters in a function declaration but can include it in the function definition, e.g.:</p>
  
  <p><strong>.h file</strong></p>
  
  <pre><code>void func(int n, long l);
  </code></pre>
  
  <p><strong>.cpp file</strong></p>
  
  <pre><code>void func(const int n, const long l)
  </code></pre>
  
  <p>Is there a reason for this? It seems a little unusual to me.</p>