title: std::out_of_range error?
body: <p>I'm dealing with a file with a linked list of lines with each node looking like this:</p>
  
  <pre><code>struct TextLine{
      //The actual text
      string text;
      //The line number of the document
      int line_num;
      //A pointer to the next line
      TextLine * next;
  };
  </code></pre>
  
  <p>and I'm writing a function that adds spaces at the beginning of the lines found in the variable <code>text</code>, by calling functions like <code>linelist_ptr-&gt;text.insert(0,1,'\t');</code></p>
  
  <p>The program compiles, but when I run it I get this error:</p>
  
  <pre><code>terminate called after throwing an instance of 'std::out_of_range'
    what():  basic_string::at
  Aborted
  </code></pre>
  
  <p>Any ideas?</p>