title: pass vector by reference or by pointer
body: <p>I have the following function: </p>
  
  <pre><code>void write_to_File(std::vector&lt;uint16_t&gt; *vector) {
      std::fstream file;
      file.open(writePath, std::fstream::out | std::fstream::binary);
      if (file.is_open()) {
           file.write(reinterpret_cast&lt;char*&gt;(&amp;(*vector)[0]), vector-&gt;size()*sizeof(uint16_t));
      } else {
          std::cout &lt;&lt; "file not found!";
          return;
      }
      file.close();
  }
  </code></pre>
  
  <p>This method doesn't actually change <code>vector</code>, but since it is getting casted I can't make it a const reference. If I use just a reference then cpplint will complain it has to be either const or a pointer. </p>
  
  <blockquote>
    <p>warning: Is this a non-const reference? If so, make const or use a pointer: std::vector &amp;vector  [runtime/references] [2]</p>
  </blockquote>
  
  <p>Should I just ignore cpplint and make it a reference, keep this code (with the pointer) or make it a const reference and cast a copy?</p>