title: Parameter Passing Etiquette (C++) const& vs. value
body: <p><strong>If all a function needs to do with a parameter is see its value, shouldn't you always pass that parameter by constant reference?</strong>  </p>
  
  <p>A colleague of mine stated that it doesn't matter for small types, but I disagree.</p>
  
  <p>So is there any advantage to do this:</p>
  
  <pre><code>void function(char const&amp; ch){ //&lt;- const ref
      if (ch == 'a'){
          DoSomething(ch);
      }
      return;
  }
  </code></pre>
  
  <p>over this:</p>
  
  <pre><code>void function(char ch){ //&lt;- value
      if (ch == 'a'){
          DoSomething(ch);
      }
      return;
  }
  </code></pre>
  
  <p>They appear to be the same size to me:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  
  int main(){
  
      char ch;
      char&amp; chref = ch;
  
      std::cout &lt;&lt; sizeof(ch) &lt;&lt; std::endl; //1
      std::cout &lt;&lt; sizeof(chref) &lt;&lt; std::endl; //1
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>But I do not know if this is always the case.<br>
  I believe I'm right, because it does not produce any additional overhead and it is self documenting.<br>
  However, I want to ask the community if my reasoning and assumptions are correct?</p>