title: How should I use storage class specifiers like ref, in, out, etc. in function arguments in D?
body: <p>There are comparatively many storage class specifiers for functions arguments in D, which are: </p>
  
  <ul>
  <li><em>none</em></li>
  <li><code>in</code> (which is equivalent to <code>const scope</code>)</li>
  <li><code>out</code></li>
  <li><code>ref</code></li>
  <li><code>scope</code></li>
  <li><code>lazy</code></li>
  <li><code>const</code></li>
  <li><code>immutable</code></li>
  <li><code>shared</code></li>
  <li><code>inout</code></li>
  </ul>
  
  <p>What's the rational behind them? Their names already put forth the obvious use. However, there are some open questions:</p>
  
  <ol>
  <li>Should I use <code>ref</code> combined with <code>in</code> for <code>struct</code> type function arguments by default? </li>
  <li>Does <code>out</code> imply <code>ref</code> implicitely?</li>
  <li>When should I use <em>none</em>?</li>
  <li>Does <code>ref</code> on classes and/or interfaces make sense? (Class types are references by default.)</li>
  <li>How about <code>ref</code> on array slices?</li>
  <li>Should I use <code>const</code> for built-in arithmetic types, whenever possible?</li>
  </ol>
  
  <p>More generally put: When and why should I use which storage class specifier for function argument types in case of built-in types, arrays, structs, classes and interfaces?
  (In order to isolate the scope of the question a little bit, please don't discuss <code>shared</code>, since it has its own isolated meaning.)</p>