title: Processing files larger than 2 GB in C++ with STL
body: <p>I am doing binary file processing and in my algorithm I would like to know the actual type of <code>pos_type</code> and <code>off_type</code>, for example when computing the size of the file or seeking to a given position (<code>tellg</code> and <code>seekg</code>).</p>
  
  <p>When computing the size of the file I just <code>static_cast</code> the <code>pos_type</code> to an <code>int64_t</code> and it seems to work fine.</p>
  
  <p>How about <code>seekg</code>? Is it safe to pass an <code>int64_t</code> to it?</p>
  
  <p><strong>Is there a way to make</strong> <code>pos_type</code> <strong>and</strong> <code>off_type</code> <strong>to be an</strong> <code>int64_t</code>, <strong>perhaps using</strong> <code>traits</code><strong>?</strong></p>
  
  <p>I would like to eliminate the hideous cast and find a way that is in accordance with the C++ standard.</p>
  
  <p><strong>Update: see also</strong></p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/q/8756496/341970">Is it safe to assign pos_type to uint64_t when dealing with large files (&gt; 2GB)?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/660667/iostream-and-large-file-support">iostream and large file support</a></p></li>
  </ul>