title: C++ optimization of reference-to-pointer argument
body: <p>I'm wondering with functions like the following, whether to use a temporary variable (p):  </p>
  
  <pre><code>void parse_foo(const char*&amp; p_in_out,
                 foo&amp; out) {
      const char* p = p_in_out;
  
      /* Parse, p gets incremented etc. */
  
      p_in_out = p;
  }
  </code></pre>
  
  <p>or can I just use the original argument and expect it to be optimized similarly to the above anyway? It seems like there should be such an optimization, but I've seen the above done in a few places such as Mozilla's code, with vague comments about "avoiding aliasing".</p>