title: how can I initialize a vector of lists in C++?
body: <p>I want to initialize a <code>vector</code> of <code>list&lt;int&gt;</code> . I used <code>fill</code> function, but my compiler shows error. Please help me in this direction.</p>
  
  <pre><code>std::vector&lt;std::list&lt;int&gt;&gt; neighbors(NRecords);
  std::fill(neighbors.begin,neighbors.end,&amp;std::vector&lt;int&gt;(NNeighbors)); // ERROR
  </code></pre>
  
  <blockquote>
    <p>ERROR: Error 2 error C3867: 'std::vector&lt;_Ty>::begin': function call missing argument list; use '&amp;std::vector&lt;_Ty>::begin' to create a pointer to member   ...</p>
  </blockquote>