title: Put Value to Empty Location in std::vector
body: <p>I have this method</p>
  <pre class="lang-cpp prettyprint-override"><code>public: void reserveMemory(int start, i32 space) {
      for (int index = start; index &lt; start + space; index++)
      {
          this-&gt;memory.at(index) = (i32)0;
      }
  }
  </code></pre>
  <p>and when <code>this-&gt;memory.at(index)</code> is empty it throws an error. How am I going to put a value to that location when the index is empty?</p>
  <p>Notes:</p>
  <ul>
  <li><code>this-&gt;memory</code> is a <code>std::vector&lt;i32&gt;</code>.</li>
  <li><code>i32</code> is <code>int32_t</code> and defined with <code>typedef int32_t i32;</code>.</li>
  <li>This is in a class.</li>
  </ul>
  <p>Exception message:</p>
  <blockquote>
  <p>Unhandled exception at 0x00007FFE4E8CD759 in Tests.exe: Microsoft C++ exception: std::out_of_range at memory location.</p>
  </blockquote>