title: How to initialize a vector<int> v(1000) with values {1,1,1,...,1} without a loop in C++?
body: <p>We can initialize a <code>vector</code> in <code>C++11</code> in the following way</p>
  
  <pre><code>vector&lt;int&gt; v {1,2,3,4,5,6}
  </code></pre>
  
  <p>But what if I want to initialize a <code>vector&lt;int&gt; v(1000)</code> with values <code>{1,1,1,1....1}</code>?</p>
  
  <hr>
  
  <p>In python it would be:</p>
  
  <pre><code>somelist [1] * 1000
  </code></pre>
  
  <p>I'm not sure if Python has a loop behind that line but my goal by omitting the loop is to do better in terms of performance and a simpler code.</p>